Subject: | Assertions on hash references do not work |
The following code in a test:
my $hashref = {};
$self->assert ($hashref);
will fail with: can't call method "can" on unblessed reference. Variant:
my $scalarref = \"foobar";
$self->assert ($scalarref);
will fail with: Don't know how to normalize SCALAR(0x85dd580) (ref SCALAR)
The first case is a bug, the second IMHO a nuisance. The "normalization" is a surprising feature, and not really helpful. Besides, the documentation seems to divert from the implementation in Test::Unit::Assert.
My expectation was that assert() would succeed if its first argument evaluates to a truth value. It's Perl after all.
Regards,
Guido