From b9841300cb47cee9d6cda24b3477c763530b947f Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 8 Mar 2012 21:08:21 -0600 Subject: fix test suite for carp dot stuff --- t/detect.t | 12 ++++++------ t/eval.t | 12 ++++++------ t/html.t | 20 ++++++++++---------- t/term.t | 24 ++++++++++++------------ 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/t/detect.t b/t/detect.t index 6c4f7d3..5104fa0 100644 --- a/t/detect.t +++ b/t/detect.t @@ -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(<foo at -e line 7\n", + qr+foo at -e line 7\b+, "detection works for terminal output"); diff --git a/t/eval.t b/t/eval.t index 7ccd181..fbed876 100644 --- a/t/eval.t +++ b/t/eval.t @@ -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(< 4; } -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(<foo at -e line 2\n", + qr+foo at -e line 2\b+, "simple warns work"); -output_is(<foo at -e line 3\n\tmain::foo() called at -e line 5\n", + qr+foo at -e line 3\.?\n\tmain::foo\(\) called at -e line 5\n+, "warns with a stacktrace work"); -output_is(<foo at -e line 2\n", + qr+foo at -e line 2\b+, "simple dies work"); -output_is(<foo at -e line 3\n\tmain::foo() called at -e line 5\n", + qr+foo at -e line 3\.?\n\tmain::foo\(\) called at -e line 5\n+, "dies with a stacktrace work"); diff --git a/t/term.t b/t/term.t index 8eb479a..2df6b64 100644 --- a/t/term.t +++ b/t/term.t @@ -8,51 +8,51 @@ BEGIN { plan tests => 5; } -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(<