diff options
author | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-02-20 02:20:29 +0100 |
---|---|---|
committer | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-02-20 02:20:29 +0100 |
commit | f1ae759f2000978c28efed057ae7697fcaeb92a1 (patch) | |
tree | 020580a3169f4a287faf6411ae9a1db529d7708c /t | |
parent | 229120ffb20bc9c3199a5abe38c4637bc631120d (diff) | |
download | sbotools2-f1ae759f2000978c28efed057ae7697fcaeb92a1.tar.xz |
Test::Execute: Add way to test output using a subroutine reference
Diffstat (limited to 't')
-rwxr-xr-x | t/Test/Execute.pm | 2 |
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"); } |