From 39eaa3cfc1a861cf898d89fbe320ffa858f41939 Mon Sep 17 00:00:00 2001 From: Katharine Hyatt Date: Mon, 19 Aug 2024 11:38:52 -0400 Subject: [PATCH] Add test for upper/lower/titlecase and fix missing import (#55443) --- base/strings/annotated.jl | 2 +- base/strings/unicode.jl | 2 +- test/strings/annotated.jl | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/base/strings/annotated.jl b/base/strings/annotated.jl index f077c577237d0..be4c6887d4a6d 100644 --- a/base/strings/annotated.jl +++ b/base/strings/annotated.jl @@ -384,7 +384,7 @@ a vector of region–annotation tuples. In accordance with the semantics documented in [`AnnotatedString`](@ref), the order of annotations returned matches the order in which they were applied. -See also: `annotate!`. +See also: [`annotate!`](@ref). """ annotations(s::AnnotatedString) = s.annotations diff --git a/base/strings/unicode.jl b/base/strings/unicode.jl index 3c6710025077c..ad047514c85a6 100644 --- a/base/strings/unicode.jl +++ b/base/strings/unicode.jl @@ -6,7 +6,7 @@ module Unicode import Base: show, ==, hash, string, Symbol, isless, length, eltype, convert, isvalid, ismalformed, isoverlong, iterate, AnnotatedString, AnnotatedChar, annotated_chartransform, - @assume_effects + @assume_effects, annotations # whether codepoints are valid Unicode scalar values, i.e. 0-0xd7ff, 0xe000-0x10ffff diff --git a/test/strings/annotated.jl b/test/strings/annotated.jl index e985c0b421a51..c8fa0680113a7 100644 --- a/test/strings/annotated.jl +++ b/test/strings/annotated.jl @@ -64,6 +64,9 @@ end @testset "AnnotatedChar" begin chr = Base.AnnotatedChar('c') @test chr == Base.AnnotatedChar(chr.char, Pair{Symbol, Any}[]) + @test uppercase(chr) == Base.AnnotatedChar('C') + @test titlecase(chr) == Base.AnnotatedChar('C') + @test lowercase(Base.AnnotatedChar('C')) == chr str = Base.AnnotatedString("hmm", [(1:1, :attr => "h0h0"), (1:2, :attr => "h0m1"), (2:3, :attr => "m1m2")])