Skip to content

Commit 03d6123

Browse files
committed
Fix _allocate call in latin.jl
1 parent a600205 commit 03d6123

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/latin.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function string(collection::MS_ASCIILatin...)
2222
@inbounds for str in collection
2323
len += ncodeunits(str)
2424
end
25-
buf, pnt = _allocate(len)
25+
buf, pnt = _allocate(UInt8, len)
2626
@inbounds for str in collection
2727
len = ncodeunits(str)
2828
_memcpy(pnt, pointer(str), len)

test/basic.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ for T in AllCharTypes
3030
test_strings_base[T] = [String(rand(T, len)) for len in test_string_length]
3131
end
3232

33+
@testset "string" begin
34+
a = ASCIIStr("ascii")
35+
b = LatinStr("latin")
36+
@test typeof(a * a) === ASCIIStr
37+
@test typeof(b * b) === LatinStr
38+
@test typeof(a * b) === LatinStr
39+
end
40+
3341
@testset "constructors" begin
3442
for (ST, type_list) in compat_types, CT in type_list, str in test_strings_base[CT]
3543
@eval @test convert($ST, $str) == $str

0 commit comments

Comments
 (0)