From f1ae759f2000978c28efed057ae7697fcaeb92a1 Mon Sep 17 00:00:00 2001 From: Andreas Guldstrand Date: Sat, 20 Feb 2016 02:20:29 +0100 Subject: Test::Execute: Add way to test output using a subroutine reference --- t/Test/Execute.pm | 2 ++ 1 file changed, 2 insertions(+) (limited to 't/Test/Execute.pm') 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"); } -- cgit v1.2.3