Changeset 3371 for t/subroutines/operator_overloading.t
- Timestamp:
- 05/18/05 02:43:02 (4 years ago)
- svk:copy_cache_prev:
- 4945
- Files:
-
- 1 modified
-
t/subroutines/operator_overloading.t (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
t/subroutines/operator_overloading.t
r3370 r3371 4 4 use Test; 5 5 6 plan 1 1;6 plan 15; 7 7 8 8 =pod … … 53 53 :todo<feature>); 54 54 55 # don't know if these syntaxes are legal... 55 56 eval_ok('sub infix:"<"($one, $two) { return (rand(1) <=> 0.5) }', 56 "quoted infix subs", :todo<bug>); 57 "quoted infix sub", :todo<bug>); 58 eval_ok('sub infix:«<»($one, $two) { return (rand(1) <=> 0.5) }', 59 "frenchquoted infix sub", :todo<bug>); 57 60 58 61 sub postfix:<W> ($wobble) { return "ANDANDAND$wobble"; }; … … 60 63 is("boop" W, "ANDANDANDboop", 61 64 'postfix operator overloading for new operator'); 65 66 sub postfix:<&&&&&> ($wobble) { return "ANDANDANDANDAND$wobble"; }; 67 is("boop"&&&&&, "ANDANDANDANDANDboop", 68 "postfix operator overloading for new operator (weird)"); 62 69 63 70 my $var = 0; … … 69 76 is(Σ [1..10], 55, "sum prefix operator"); 70 77 78 # check that the correct overloaded method is called 71 79 sub postfix:<!> ($x) { [*] 1..$x } 80 sub postfix:<!> (Str $x) { return($x.uc ~ "!!!") } 81 72 82 is(10!, 3628800, "factorial postfix operator"); 83 is("boobies"!, "BOOBIES!!!", "correct overloaded method called"); 73 84 74 85
