ok( $var1 eq 'foo' || $var1 eq 'bar', 'either foo or bar');
i.e. make an expression that checks $var1 against both posibilities, and evaluates to either some true or some false value. Don't use
is( $var1 eq 'foo' ? 1 : $var1 eq 'bar'? 1 : undef, 1, 'either foo or +bar');
- that is syntax is explicitly discouraged in the docs. Thanks to ikegami for pointing that out via /msg.
--shmem
update: removed cluttered ternary op suggestion, incorporated ikegami's /msg.
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
In reply to Re: 'either or' value unit test case in Test::Simple or Test::More
by shmem
in thread 'either or' value unit test case in Test::Simple or Test::More
by palette
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |