Help language development. Donate to The Perl Foundation
Test::Color - Colored Test - output
use Test;
use Test::Color;
use Test::Color sub { :ok("blue on_green"), :nok("255,0,0 on_255,255,255") };
Test::Color uses Terminal::ANSIColor to color your test output. Simply add the use Color
statement to your test script.
If you don't like the default colors, you can configure them by passing an anonymous sub to the use statement.
The sub must return a hash; keys representing the output category (one of
You can tweak the behaviour even further by setting output handles of the Test
module directly.
Test::output() = Test::Color.new( :handle($SOME-HANDLE) );
Test::failure_output() = Test::Color.new( :handle($SOME-HANDLE) );
Test::todo_output() = Test::Color.new( :handle($SOME-HANDLE) );
This module works using escape sequences. This means that test suite runners will most likely trip over it. The module is mainly meant for the development phase, by helping to spot problematic tests in longish test outputs.
Markus 'Holli' Holzer
Copyright © [email protected]
License GPLv3: The GNU General Public License, Version 3, 29 June 2007 https://www.gnu.org/licenses/gpl-3.0.txt
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.