Lines Matching full:given
21 CORE::given(3) {
22 CORE::when(3) { pass "CORE::given and CORE::when"; continue }
39 given(my $x = "bar") {
40 is($x, "bar", "given scope starts");
42 is($x, "foo", "given scope ends");
47 given(my $x = "foo") {
49 is($x, "bar", "given scope starts");
51 is($x, "foo", "given scope ends");
55 given("inside") { check_outside1() }
62 given(3) {
74 given(3.14159265) {
85 given(3) {
97 given("c") {
108 given("c") {
120 given (0) { when(undef) {$ok = 0} }
121 is($ok, 1, "Given(0) when(undef)");
126 given (0) { when($undef) {$ok = 0} }
127 is($ok, 1, 'Given(0) when($undef)');
132 given (0) { when($undef++) {$ok = 1} }
133 is($ok, 1, "Given(0) when($undef++)");
138 given (undef) { when(0) {$ok = 0} }
139 is($ok, 1, "Given(undef) when(0)");
145 given ($undef) { when(0) {$ok = 0} }
146 is($ok, 1, 'Given($undef) when(0)');
151 given ("") { when(undef) {$ok = 0} }
152 is($ok, 1, 'Given("") when(undef)');
157 given ("") { when($undef) {$ok = 0} }
158 is($ok, 1, 'Given("") when($undef)');
163 given (undef) { when("") {$ok = 0} }
164 is($ok, 1, 'Given(undef) when("")');
170 given ($undef) { when("") {$ok = 0} }
171 is($ok, 1, 'Given($undef) when("")');
176 given (undef) { when(undef) {$ok = 1} }
177 is($ok, 1, "Given(undef) when(undef)");
182 given (undef) { when($undef) {$ok = 1} }
183 is($ok, 1, 'Given(undef) when($undef)');
188 given ($undef) { when(undef) {$ok = 1} }
189 is($ok, 1, 'Given($undef) when(undef)');
194 given ($undef) { when($undef) {$ok = 1} }
195 is($ok, 1, 'Given($undef) when($undef)');
202 given("Hello, world!") {
221 given($twenty_five) {
236 given($twenty_five) {
250 given($twenty_five) {
265 given($twenty_five) {
280 given($twenty_five) {
294 given($twenty_five) {
309 given($twenty_five) {
324 given($twenty_five) {
339 given($twenty_five) {
353 given($twenty_five) {
367 given($twenty_five) {
381 given($twenty_five) {
394 given(23) {
403 given(23) {
417 given("op") {
431 given("foo") {
439 given("foo") {
448 given("foo") {
457 given(12) {
467 given(0) {
478 given(0) {
488 given(0) {
498 given("foo") {
512 given ($l) {
523 given ($l) {
533 given("foo") {
543 given("foo") {
578 { my $test_name = "Multiple FETCHes in given, due to aliasing";
580 given($v = 23) {
596 given(23) {
612 given("23") {
629 given(my $undef) {
683 given("foo") {
699 given("foxy!") {
708 given("foggy") {
750 my $test = "Overloaded obj in given (true)";
753 given($obj) {
763 my $test = "Overloaded obj in given (false)";
766 given($obj) {
778 given("topic") {
794 given("topic") {
810 given (undef) {
817 given (2) {
827 given ("apple") {
836 given ("pear") {
848 given(my $x = "foo") {
858 given(my $x = 1) {
869 given ($_) {
879 given ($_) {
889 given ($_) {
899 given ($_) {
907 # Test goto with given/when
912 GIVEN1: given ($flag) {
920 given ($flag) {
926 is($flag, 1, "goto inside given");
930 given ($flag) {
935 is($flag, 1, "goto inside given and when");
949 given ($flag) {
954 is($flag, 1, "goto inside given and when to the given stmt");
964 # Test do { given } as a rvalue
973 my $scalar = do { given ($_) {
978 is($scalar, shift(@exp), "rvalue given - simple scalar [$_]");
987 my $scalar = do { given ($_) {
992 is($scalar, shift(@exp), "rvalue given - postfix scalar [$_]");
999 my $scalar = do { given ($_) {
1005 is($scalar, shift(@exp), "rvalue given - default scalar [$_]");
1013 my @list = do { given ($_) {
1018 is("@list", shift(@exp), "rvalue given - simple list [$_]");
1026 my @list = do { given ($_) {
1031 is("@list", shift(@exp), "rvalue given - postfix list [$_]");
1039 my @list = do { given ($_) {
1044 is("@list", shift(@exp), "rvalue given - default list [$_]");
1051 my @list = do { given ($_) {
1057 is("@list", shift(@exp), "rvalue given - default list [$_]");
1063 do { given ($_[0]) {
1073 is($scalar, 'undef', "rvalue given - scalar context propagation [undef]");
1076 is($scalar, 5, "rvalue given - scalar context propagation [4]");
1079 is($scalar, undef, "rvalue given - scalar context propagation [999]");
1084 is("@list", 'undef', "rvalue given - list context propagation [undef]");
1087 is("@list", '1 2 3', "rvalue given - list context propagation [2]");
1090 is("@list", '4 5', "rvalue given - list context propagation [4]");
1093 is("@list", '', "rvalue given - list context propagation [999]");
1101 given ($_) {
1120 given ($_) {
1137 given ($_) {
1158 given ($id) {
1188 given-lexical
1189 given-global
1190 given-local
1205 given ($id_plus_1) {
1223 # Check that values returned from given/when are destroyed at the right time.
1255 given ($id) {
1268 is $res_id, $id, "given/when returns the right object - $desc";
1269 is $destroyed, 1, "given/when does not leak - $desc";
1276 given ("x") {
1288 # must ensure $_ is initialised and cleared at start/end of given block
1298 given(bless [7]) {
1350 given("xyz") {
1368 given("xyz") {
1374 given("xyz") {