aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-02-20 02:20:29 +0100
committerAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-02-20 02:20:29 +0100
commitf1ae759f2000978c28efed057ae7697fcaeb92a1 (patch)
tree020580a3169f4a287faf6411ae9a1db529d7708c /t
parent229120ffb20bc9c3199a5abe38c4637bc631120d (diff)
downloadsbotools2-f1ae759f2000978c28efed057ae7697fcaeb92a1.tar.xz
Test::Execute: Add way to test output using a subroutine reference
Diffstat (limited to 't')
-rwxr-xr-xt/Test/Execute.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/t/Test/Execute.pm b/t/Test/Execute.pm
index 4231e9f..2513e08 100755
--- a/t/Test/Execute.pm
+++ b/t/Test/Execute.pm
@@ -78,6 +78,8 @@ sub run {
SKIP: { skip "Expected output undefined", 1 }
} elsif (ref $expected eq 'Regexp') {
like ($output, $expected, "$name - output");
+ } elsif (ref $expected eq 'CODE') {
+ ok ($expected->($output), "$name - output");
} else {
is ($output, $expected, "$name - output");
}