Skip to content

Commit

Permalink
refactor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bkamins committed Oct 22, 2017
1 parent b0af0f9 commit 905354c
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions test/strings/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -619,19 +619,23 @@ end
end
end

@test prevind(SubString(strs[i], 1, 4), 0) < 1
@test prevind(SubString(strs[i], 1, 4), 0, 1) < 1
@test prevind(SubString(strs[i], 1, 4), 1, 2) < 1
@test prevind(SubString(strs[i], 1, 4), 0, 2) < 1
@test prevind(SubString(strs[i], 7, 10), 1) < 1
@test prevind(SubString(strs[i], 7, 10), 1, 1) < 1
@test prevind(SubString(strs[i], 7, 10), 0) < 1
@test prevind(SubString(strs[i], 7, 10), 0, 1) < 1
@test prevind(SubString(strs[i], 7, 10), 1, 2) < 1
@test nextind(SubString(strs[i], 7, 10), 4) > endof(strs[i])
@test nextind(SubString(strs[i], 7, 10), 4, 1) > endof(strs[i])
@test nextind(SubString(strs[i], 7, 10), 9) > endof(strs[i])
@test nextind(SubString(strs[i], 7, 10), 9, 1) > endof(strs[i])
let ss = SubString(strs[i], 1, 4)
@test prevind(ss, 0) < 1
@test prevind(ss, 0, 1) < 1
@test prevind(ss, 1, 2) < 1
@test prevind(ss, 0, 2) < 1
end
let ss = SubString(strs[i], 7, 10)
@test prevind(ss, 1) < 1
@test prevind(ss, 1, 1) < 1
@test prevind(ss, 0) < 1
@test prevind(ss, 0, 1) < 1
@test prevind(ss, 1, 2) < 1
@test nextind(ss, 4) > endof(ss)
@test nextind(ss, 4, 1) > endof(ss)
@test nextind(ss, 9) > endof(ss)
@test nextind(ss, 9, 1) > endof(ss)
end
end

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

0 comments on commit 905354c

Please sign in to comment.