Skip to content

Commit a23ce4b

Browse files
authored
Add tests for eltype(::Type{<:AbstractString}) (JuliaLang#58728)
1 parent 895a981 commit a23ce4b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/strings/basic.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,3 +1463,12 @@ if Sys.iswindows()
14631463
@test Base.cwstring(str_3) == UInt16[0x0061, 0x0723, 0xd808, 0xdc00, 0x0000]
14641464
end
14651465
end
1466+
1467+
1468+
@testset "eltype for AbstractString subtypes" begin
1469+
@test eltype(String) == Char
1470+
@test eltype(SubString{String}) == Char
1471+
1472+
u = b"hello"
1473+
@test eltype(u) === UInt8
1474+
end

0 commit comments

Comments
 (0)