Skip to content

Commit 0ff52db

Browse files
committed
fixed tests on 0.6
1 parent 4fed165 commit 0ff52db

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/LegacyStrings.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ import Compat:
4848
ncodeunits
4949

5050

51-
if VERSION <= v"0.7-"
51+
if VERSION < v"0.7-"
5252
import Base: lcfirst
5353
import Base: next
5454
import Base: rsearch

test/runtests.jl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,11 @@ let ch = 0x10000
207207
end
208208

209209
let str = UTF8String(b"this is a test\xed\x80")
210-
@test iterate(str, 15) == ('\ufffd', 16)
210+
@static if VERSION < v"0.7-"
211+
@test next(str, 15) == ('\ufffd', 16)
212+
else
213+
@test iterate(str, 15) == ('\ufffd', 16)
214+
end
211215
@test_throws BoundsError getindex(str, 0:3)
212216
@test_throws BoundsError getindex(str, 17:18)
213217
@test_throws BoundsError getindex(str, 2:17)
@@ -544,8 +548,13 @@ let
544548

545549
@test lastindex(srep) == 7
546550

547-
@test iterate(srep, 3) == ('β',5)
548-
@test iterate(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
549558

550559
@test srep[7] == 'β'
551560
@static if VERSION < v"0.7.0-DEV.2924"

0 commit comments

Comments
 (0)