1#!/usr/bin/perl -w 2 3package Foo; 4 5use strict; 6use Test::Warn; 7use Test::More 'no_plan'; 8 9use Method::Signatures; 10 11method foo(:$name, :$value) { 12 return $name, $value; 13} 14 15 16TODO: { 17 # Test::Warn is having issues with $TODO. 18 Test::More->builder->todo_start("Odd number of elements should happen at the caller"); 19 20#line 20 21 my @result; 22 warning_like { 23 @result = Foo->foo(name => 42, value =>); 24 } qr/^Odd number of elements in hash assignment at \Q$0\E line 22.$/; 25 26 Test::More->builder->todo_end; 27 28 # Or should it be an error? 29 is_deeply \@result, [42, undef]; 30} 31