From: Graham Knop Date: Thu, 27 Sep 2018 11:28:59 +0000 (+0200) Subject: test with non-experimental feature X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;p=p5sagit%2Flib-with-preamble.git test with non-experimental feature --- diff --git a/t/example.t b/t/example.t index 7ab914a..6dd61ac 100644 --- a/t/example.t +++ b/t/example.t @@ -9,9 +9,9 @@ ok(eval { require my_given_example; 1 }, 'Loaded module'); sub result_for { eval { my_given_example::example_sub($_[0]) } } -is(result_for(1), 'positive'); -is(result_for(-1), 'negative'); -is(result_for(0), 'zero'); +is(result_for(42), 42); +is(result_for(-1), 42); +is(result_for(0), 42); is(my_given_example::my_file(), File::Spec->catfile(qw(t lib my_given_example.pm))); -is(my_given_example::my_line(), 12); +is(my_given_example::my_line(), 8); diff --git a/t/lib/my_given_example.pm b/t/lib/my_given_example.pm index f241838..8092d31 100644 --- a/t/lib/my_given_example.pm +++ b/t/lib/my_given_example.pm @@ -1,11 +1,7 @@ package my_given_example; sub example_sub { - given ($_[0]) { - when ($_ > 0) { return 'positive' } - when ($_ < 0) { return 'negative' } - return 'zero' - } + state $foo = $_[0]; } sub my_file { __FILE__ }