summaryrefslogtreecommitdiffstats
path: root/t/detect.t
diff options
context:
space:
mode:
Diffstat (limited to 't/detect.t')
-rw-r--r--t/detect.t12
1 files changed, 6 insertions, 6 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(<<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");