Skip to content

Commit

Permalink
Merge pull request #12305 from ScottPJones/spj/iotests
Browse files Browse the repository at this point in the history
Add coverage tests for print_joined, print_unescaped, unescape_chars
  • Loading branch information
jakebolewski committed Jul 27, 2015
2 parents 39bd1fc + 1f40561 commit bc9b435
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/strings/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,14 @@ Base.next(jt::i9178, n) = (jt.nnext += 1 ; ("$(jt.nnext),$(jt.ndone)", n+1))
@test "$("string")" == "string"
arr = ["a","b","c"]
@test "[$(join(arr, " - "))]" == "[a - b - c]"

# print_joined with empty input
myio = IOBuffer()
print_joined(myio, "", "", 1)
@test isempty(takebuf_array(myio))

# unescape_chars
@test Base.unescape_chars("\\t","t") == "t"
@test_throws ArgumentError print_unescaped(IOBuffer(), string('\\',"xZ"))
@test_throws ArgumentError print_unescaped(IOBuffer(), string('\\',"777"))

0 comments on commit bc9b435

Please sign in to comment.