Changeset 22003
- Timestamp:
- 08/21/08 21:39:26 (3 months ago)
- Files:
-
- 1 modified
-
t/spec/S03-operators/reduce-metaop.t (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
t/spec/S03-operators/reduce-metaop.t
r21984 r22003 93 93 # 18:45 < autrijus> [=>] 1..10; 94 94 my $list = [=>] 1,2,3; 95 is $list.key, 1, "[=>] works (1)";96 is try({$list.value.key}), 2, "[=>] works (2)";97 is try({$list.value.value}), 3, "[=>] works (3)";95 is $list.key, 1, "[=>] works (1)"; 96 is (try {$list.value.key}), 2, "[=>] works (2)"; 97 is (try {$list.value.value}), 3, "[=>] works (3)"; 98 98 } 99 99 … … 109 109 # Check that user defined infix ops work with [...], too. 110 110 sub infix:<more_than_plus>(Int $a, Int $b) { $a + $b + 1 } 111 is( try({ [more_than_plus] 1, 2, 3 }), 8, "[...] reduce metaop works on user defined ops", :todo<bug>);111 is( (try { [more_than_plus] 1, 2, 3 }), 8, "[...] reduce metaop works on user defined ops", :todo<bug>); 112 112 113 113 # { … … 138 138 is($b, 3, '[=] assigns successfully (2)'); 139 139 140 ok try({ ([=] $a, $b, 4) = 5 }), '[=] lvalue context restored (1)';140 lives_ok { ([=] $a, $b, 4) = 5 }, '[=] lvalue context restored (1)'; 141 141 is($a, 5, '[=] lvalue context restored (2)'); 142 142 is($b, 4, '[=] lvalue context restored (3)');
