X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F13-data.t;h=41e0b3acfb41f769aea662e4cc50fd6c8ba737ba;hb=745e2c898af9671e06e60785082caa6c291387d2;hp=d1dc440200c0dd2a38cb72414ecd2ed6fac8ea9b;hpb=2eff3964bde4659b291a8d944cabbaef604f40c2;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/t/13-data.t b/t/13-data.t index d1dc440..41e0b3a 100644 --- a/t/13-data.t +++ b/t/13-data.t @@ -50,11 +50,11 @@ is($c, 40, 'set magic : pass data'); is($data->{bar}, 40, 'set magic : pass data'); $data = eval { getdata $a, ($sig + 1) }; -is($@, '', 'getdata from invalid sig doesn\'t croak'); +like($@, qr/Invalid\s+wizard\s+object\s+at\s+\Q$0\E/, 'getdata from invalid sig croaks'); is($data, undef, 'getdata from invalid sig returns undef'); $data = eval { getdata $a, undef }; -like($@, qr/Invalid\s+wizard\s+object/, 'getdata from undef croaks'); +like($@, qr/Invalid\s+wizard\s+object\s+at\s+\Q$0\E/, 'getdata from undef croaks'); is($data, undef, 'getdata from undef doesn\'t return anything'); $res = eval { dispell $a, $wiz }; @@ -78,9 +78,9 @@ $res = eval { cast $a, $wiz }; is($@, '', 'cast non-data wizard doesn\'t croak'); ok($res, 'cast non-data wizard returns true'); -$data = eval { getdata $a, $wiz }; -is($@, '', 'getdata from non-data wizard doesn\'t croak'); -is($data, undef, 'getdata from non-data wizard invalid returns undef'); +my @data = eval { getdata $a, $wiz }; +is($@, '', 'getdata from non-data wizard doesn\'t croak'); +is_deeply(\@data, [ ], 'getdata from non-data wizard invalid returns undef'); $wiz = wizard data => sub { ++$_[1] }; my ($di, $ei) = (1, 10);