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/eval.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/eval.t')
-rw-r--r-- | t/eval.t | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -8,25 +8,25 @@ 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; eval { die "foo" }; if (\$@) { die \$@; } EOF - "\e[31m\e[31mfoo\e[m\e[m at -e line 2\n\teval {...} called at -e line 4\n", + qr/\e\[31m\e\[31mfoo\e\[m\e\[m at -e line 2\.?\n\teval {\.\.\.} called at -e line 4\b/, "rethrowing works"); -output_is(<<EOF, +output_like(<<EOF, use Carp::Always::Color; sub foo { eval { die "foo" }; @@ -36,5 +36,5 @@ output_is(<<EOF, } foo(); EOF - "\e[31m\e[31mfoo\e[m\e[m at -e line 3\n\teval {...} called at -e line 3\n\tmain::foo() called at -e line 5\n\tmain::foo() called at -e line 8\n", + qr/\e\[31m\e\[31mfoo\e\[m\e\[m at -e line 3\.?\n\teval {\.\.\.} called at -e line 3\n\tmain::foo\(\) called at -e line 5\.?\n\tmain::foo\(\) called at -e line 8\n/, "rethrowing works inside functions"); |