in reply to Re^3: Tests on Windows for Unix-only module
in thread Tests on Windows for Unix-only module

Basically when you're giving skip/ok subs, you don't want to run other ok/skips inside, you want the return value

ok( wanted, gotten, testname )

skip( skipit, wanted, gotten, testname )

$ perl -MTest -le " plan tests=>1; skip 0, sub{ -monkeys }, sub {-bana +nas } ; 1..1 # Running under perl version 5.016001 for MSWin32 # Current time local: Mon Dec 29 22:53:31 2014 # Current time GMT: Tue Dec 30 06:53:31 2014 # Using Test.pm version 1.25_02 not ok 1 # Test 1 got: "-monkeys" (-e at line 1) # Expected: "-bananas" $ perl -MTest -le " plan tests=>1; skip 1, sub{ -monkeys }, sub {-bana +nas } ; 1..1 # Running under perl version 5.016001 for MSWin32 # Current time local: Mon Dec 29 22:53:47 2014 # Current time GMT: Tue Dec 30 06:53:47 2014 # Using Test.pm version 1.25_02 ok 1 # skip $ perl -MTest -le " plan tests=>1; ok sub{ -monkeys }, sub {-bananas } + ; 1..1 # Running under perl version 5.016001 for MSWin32 # Current time local: Mon Dec 29 22:53:53 2014 # Current time GMT: Tue Dec 30 06:53:53 2014 # Using Test.pm version 1.25_02 not ok 1 # Test 1 got: "-monkeys" (-e at line 1) # Expected: "-bananas"

Replies are listed 'Best First'.
Re^5: Tests on Windows for Unix-only module
by mikosullivan (Novice) on Jan 01, 2015 at 00:04 UTC
    Thaks for the help, folks! I ended up using Test::More, which for me personally has a more scrutable interface. Thanks!