#!/usr/bin/pugs # -*- perl -*- use v6; use Test; sub numcmp ($first, $second) { return $first <=> $second; } my @variants = ( "numcmp(3,5)", "numcmp(first=>3,second=>5)", "numcmp(second=>5, first=>3)", "numcmp(:first(3),:second(5))", "numcmp(:second(5),:first(3))", "numcmp (3,5)", "numcmp (first=>3,second=>5)", "numcmp (second=>5, first=>3)", "numcmp (:first(3),:second(5))", "numcmp (:second(5),:first(3))", "numcmp .(3,5)", "numcmp .(first=>3,second=>5)", "numcmp .(second=>5, first=>3)", "numcmp .(:first(3),:second(5))", "numcmp .(:second(5),:first(3))", ); plan @variants.elems; for @variants -> $v { eval_ok ("$v == -1"); }