Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #sub assert
- sub assert ([ Str $x,Str $y ], Int $a is raw , &op , Int $b is raw) {
- my $comp = &op.name.substr(7,*-1);
- die "assertion $x " ~ $comp ~ " $y failed : $x = $a, $y = $b" unless op($a,$b);
- }
- #call it
- assert ['x' , 'max'], $x, &[<=] , 980;
- assert ['y', 'min'] , $y, &[≥] ,50;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement