File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 230230 @test contains (str, " SUCCESS" )
231231end
232232
233+ # Issue <https://github.com/JuliaTesting/ParallelTestRunner.jl/issues/69>.
234+ @testset " Colorful output" begin
235+ testsuite = Dict (
236+ " color" => quote
237+ printstyled (" Roses Are Red" ; color= :red )
238+ end
239+ )
240+ io = IOBuffer ()
241+ ioc = IOContext (io, :color => true )
242+ runtests (ParallelTestRunner, String[]; testsuite, stdout = ioc, stderr = ioc)
243+ str = String (take! (io))
244+ @test contains (str, " \e [31mRoses Are Red\e [39m\n " )
245+ @test contains (str, " SUCCESS" )
246+
247+ testsuite = Dict (
248+ " no color" => quote
249+ print (" Violets are " )
250+ printstyled (" blue" ; color= :blue )
251+ end
252+ )
253+ io = IOBuffer ()
254+ ioc = IOContext (io, :color => false )
255+ runtests (ParallelTestRunner, String[]; testsuite, stdout = ioc, stderr = ioc)
256+ str = String (take! (io))
257+ @test contains (str, " Violets are blue\n " )
258+ @test contains (str, " SUCCESS" )
259+ end
260+
233261end
You can’t perform that action at this time.
0 commit comments