Skip to content

Commit 905354c

Browse files
committed
refactor tests
1 parent b0af0f9 commit 905354c

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

test/strings/basic.jl

+17-13
Original file line numberDiff line numberDiff line change
@@ -619,19 +619,23 @@ end
619619
end
620620
end
621621

622-
@test prevind(SubString(strs[i], 1, 4), 0) < 1
623-
@test prevind(SubString(strs[i], 1, 4), 0, 1) < 1
624-
@test prevind(SubString(strs[i], 1, 4), 1, 2) < 1
625-
@test prevind(SubString(strs[i], 1, 4), 0, 2) < 1
626-
@test prevind(SubString(strs[i], 7, 10), 1) < 1
627-
@test prevind(SubString(strs[i], 7, 10), 1, 1) < 1
628-
@test prevind(SubString(strs[i], 7, 10), 0) < 1
629-
@test prevind(SubString(strs[i], 7, 10), 0, 1) < 1
630-
@test prevind(SubString(strs[i], 7, 10), 1, 2) < 1
631-
@test nextind(SubString(strs[i], 7, 10), 4) > endof(strs[i])
632-
@test nextind(SubString(strs[i], 7, 10), 4, 1) > endof(strs[i])
633-
@test nextind(SubString(strs[i], 7, 10), 9) > endof(strs[i])
634-
@test nextind(SubString(strs[i], 7, 10), 9, 1) > endof(strs[i])
622+
let ss = SubString(strs[i], 1, 4)
623+
@test prevind(ss, 0) < 1
624+
@test prevind(ss, 0, 1) < 1
625+
@test prevind(ss, 1, 2) < 1
626+
@test prevind(ss, 0, 2) < 1
627+
end
628+
let ss = SubString(strs[i], 7, 10)
629+
@test prevind(ss, 1) < 1
630+
@test prevind(ss, 1, 1) < 1
631+
@test prevind(ss, 0) < 1
632+
@test prevind(ss, 0, 1) < 1
633+
@test prevind(ss, 1, 2) < 1
634+
@test nextind(ss, 4) > endof(ss)
635+
@test nextind(ss, 4, 1) > endof(ss)
636+
@test nextind(ss, 9) > endof(ss)
637+
@test nextind(ss, 9, 1) > endof(ss)
638+
end
635639
end
636640

637641
@test prevind(strs[1], -1) == -2

0 commit comments

Comments
 (0)