Glib-1.071/t/c.t fails under Test::More 0.53



Hello,

I noticed that t/c.t fails under recent Test::More version from CPAN:

$ perl t/c.t
1..13
[...]
ok 11 - enum property, after set
not ok 12 - flags property
#     Failed test (t/c.t at line 139)
ok 13 - flags property, after set
# Looks like you failed 1 test of 13.
$

This is apparently because Test::More::eq_array() was reworked
and got more strict.  I believe it's right time to address this issue
because next Perl release is likely to have a newer Test::More version
(perl-5.8.6 has 0.47).

Here is a quick patch that fixes the problem for me:

--- Glib-1.071/t/c.t~   2004-05-04 22:11:24 +0000
+++ Glib-1.071/t/c.t    2004-12-13 02:48:05 +0000
@@ -136,7 +136,7 @@
 $obj->set (some_enum => 'value-two');
 is ($obj->get ('some_enum'), 'value-two', 'enum property, after set');
 
-ok (eq_array ([$obj->get ('some_flags')], ['value-one']), 'flags property');
+ok ($obj->get ('some_flags') eq 'value-one', 'flags property');
 $obj->set (some_flags => ['value-one', 'value-two']);
 is ($obj->get ('some_flags'), ['value-one', 'value-two'], 
        'flags property, after set');


Details: eq_array() calls _deep_check() on each pair of elements.
_deep_check used to test ($e1 eq $e2) in the first place and return
true if so, until recently.  Now _deep_check drops stringification
overload in the first place (with Test::Builder::_unoverload()) and
tests that both elements are references or both not.

So eq_array ([$obj->get ('some_flags')], ['value-one']) no more holds.


-- 
Alexey Tourbin
ALT Linux Team



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]