diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-03-08 21:08:21 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-03-08 21:08:21 -0600 |
commit | b9841300cb47cee9d6cda24b3477c763530b947f (patch) | |
tree | aeb3dfebc87c767c57e5583fdf4bdd664f2cdfc8 /t/detect.t | |
parent | 0a0a01d1d8b1d48d68e6b8e37fc38dd4ca553b97 (diff) | |
download | carp-always-color-b9841300cb47cee9d6cda24b3477c763530b947f.tar.gz carp-always-color-b9841300cb47cee9d6cda24b3477c763530b947f.zip |
fix test suite for carp dot stuff
Diffstat (limited to 't/detect.t')
-rw-r--r-- | t/detect.t | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -8,22 +8,22 @@ BEGIN { plan tests => 2; } -sub output_is { +sub output_like { local $Test::Builder::Level = $Test::Builder::Level + 1; my ($script, $expected, $desc) = @_; my $pty = IO::Pty::Easy->new; $pty->spawn("$^X", "-e", $script); - is($pty->read, $expected, $desc); + like($pty->read, $expected, $desc); } -output_is(<<EOF, +output_like(<<EOF, use Carp::Always::Color; warn "foo"; EOF - "\e[33mfoo\e[m at -e line 2\n", + qr/\e\[33mfoo\e\[m at -e line 2\b/, "detection works for terminal output"); -output_is(<<EOF, +output_like(<<EOF, my \$stderr; BEGIN { close(STDERR); @@ -33,5 +33,5 @@ output_is(<<EOF, warn "foo"; print \$stderr; EOF - "<span style=\"color:#880\">foo</span> at -e line 7\n", + qr+<span style=\"color:#880\">foo</span> at -e line 7\b+, "detection works for terminal output"); |