@@ -6,7 +6,6 @@ using Compat: view, String
6
6
using LegacyStrings
7
7
using LegacyStrings: ASCIIString, UTF8String # override Compat's version
8
8
import LegacyStrings:
9
- ascii,
10
9
checkstring,
11
10
UnicodeError,
12
11
UTF_ERR_SHORT
@@ -208,13 +207,17 @@ let ch = 0x10000
208
207
end
209
208
210
209
let str = UTF8String (b " this is a test\x ed\x 80" )
211
- @test next (str, 15 ) == (' \u fffd' , 16 )
210
+ @static if VERSION < v " 0.7-"
211
+ @test next (str, 15 ) == (' \u fffd' , 16 )
212
+ else
213
+ @test iterate (str, 15 ) == (' \u fffd' , 16 )
214
+ end
212
215
@test_throws BoundsError getindex (str, 0 : 3 )
213
216
@test_throws BoundsError getindex (str, 17 : 18 )
214
217
@test_throws BoundsError getindex (str, 2 : 17 )
215
218
@test_throws UnicodeError getindex (str, 16 : 17 )
216
219
# @test string(Char(0x110000)) == "\ufffd"
217
- sa = SubString {ASCIIString} (ascii (" This is a silly test" ), 1 , 14 )
220
+ sa = SubString {ASCIIString} (LegacyStrings . ascii (" This is a silly test" ), 1 , 14 )
218
221
s8 = convert (SubString{UTF8String}, sa)
219
222
@test typeof (s8) == SubString{UTF8String}
220
223
@test s8 == " This is a sill"
@@ -283,7 +286,7 @@ function tstcvt(strUTF8::UTF8String, strUTF16::UTF16String, strUTF32::UTF32Strin
283
286
end
284
287
285
288
# Create some ASCII, UTF8, UTF16, and UTF32 strings
286
- strAscii = ascii (" abcdefgh" )
289
+ strAscii = LegacyStrings . ascii (" abcdefgh" )
287
290
strA_UTF8 = utf8 ((" abcdefgh\u ff" )[1 : 8 ])
288
291
strL_UTF8 = utf8 (" abcdef\u ff\u ff" )
289
292
str2_UTF8 = utf8 (" abcd\u ff\u ff\u 7ff\u 7ff" )
464
467
@test reverse (utf32 (" abcd \u ff\u 7ff\u 7fff\U 7ffff" )) == utf32 (" \U 7ffff\u 7fff\u 7ff\u ff dcba" )
465
468
466
469
# Test pointer() functions
467
- let str = ascii (" this " )
470
+ let str = LegacyStrings . ascii (" this " )
468
471
u8 = utf8 (str)
469
472
u16 = utf16 (str)
470
473
u32 = utf32 (str)
545
548
546
549
@test lastindex (srep) == 7
547
550
548
- @test next (srep, 3 ) == (' β' ,5 )
549
- @test next (srep, 7 ) == (' β' ,9 )
551
+ @static if VERSION < v " 0.7-"
552
+ @test next (srep, 3 ) == (' β' ,5 )
553
+ @test next (srep, 7 ) == (' β' ,9 )
554
+ else
555
+ @test iterate (srep, 3 ) == (' β' ,5 )
556
+ @test iterate (srep, 7 ) == (' β' ,9 )
557
+ end
550
558
551
559
@test srep[7 ] == ' β'
552
560
@static if VERSION < v " 0.7.0-DEV.2924"
0 commit comments