use Test; plan 22; sub infix: { @^a == @^b && all @a Zeqv @b } my @a = 1 , 2 , 3 ; my @b = '1', '2', '3'; ok [1, 2, 3] Meqv @a, 'Array matches Array (Int)'; ok (1, 2, 3) Meqv @a, 'List matches Array (Int)'; ok Seq(1, 2, 3) Meqv @a, 'Seq matches Array (Int)'; ok ['1', '2', '3'] Meqv @b, 'Array matches Array (Str)'; ok ('1', '2', '3') Meqv @b, 'List matches Array (Str)'; ok Seq('1', '2', '3') Meqv @b, 'Seq matches Array (Int)'; nok [1, '2', 3] Meqv @a, 'A-A: Type mismatch fails'; nok @a Meqv [1, '2', 3], 'A-A: Type mismatch fails (Flipped)'; nok (1, '2', 3) Meqv @a, 'L-A: Type mismatch fails'; nok @a Meqv (1, '2', 3), 'L-A: Type mismatch fails (Flipped)'; nok Seq(1, '2', 3) Meqv @a, 'S-A: Type mismatch fails'; nok @a Meqv Seq(1, '2', 3), 'S-A: Type mismatch fails (Flipped)'; nok [1, 2, 3, 4] Meqv @a, 'A-A: Elem mismatch fails'; nok @a Meqv [1, 2, 3, 4], 'A-A: Elem mismatch fails (Flipped)'; nok (1, 2, 3, 4) Meqv @a, 'L-A: Elem mismatch fails'; nok @a Meqv (1, 2, 3, 4), 'L-A: Elem mismatch fails (Flipped)'; nok Seq(1, 2, 3, 4) Meqv @a, 'S-A: Elem mismatch fails'; nok @a Meqv Seq(1, 2, 3, 4), 'S-A: Elem mismatch fails (Flipped)'; # This would fool Z== nok [1, (1, 2), 3] Meqv @a, 'Coercion test passes'; nok @a Meqv [1, (1, 2), 3], 'Coercion test passes (Flipped)'; # This would fool Z~~ nok [1, True, 3] Meqv @a, 'Bool test passes'; nok @a Meqv [1, True, 3], 'Bool test passes (Flipped)';