Skip to content

Commit

Permalink
Add test for upper/lower/titlecase and fix missing import (#55443)
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt authored Aug 19, 2024
1 parent fc7b40e commit 39eaa3c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion base/strings/annotated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion base/strings/unicode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions test/strings/annotated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")])
Expand Down

0 comments on commit 39eaa3c

Please sign in to comment.