Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed Dec 10, 2016
1 parent 5a9b1d7 commit 9329ab7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -484,3 +484,19 @@ let
@test c_18711 == 1
end

let
old_have_color = Base.have_color
try
eval(Base, :(have_color = true))
buf = IOBuffer()
print_with_color(:red, buf, "foo")
# Check that we get back to normal text color in the end
@test String(take!(buf)) == "\e[31mfoo\e[39m"

# Check that boldness is turned off
print_with_color(:red, buf, "foo"; bold = true)
@test String(take!(buf)) == "\e[1m\e[31mfoo\e[39m\e[22m"
finally
eval(Base, :(have_color = $(old_have_color)))
end
end

0 comments on commit 9329ab7

Please sign in to comment.