$row = $rs->create({ amount => 100 });
} 'inserted a money value';
- is eval { $rs->find($row->id)->amount }, 100, 'money value round-trip';
+ cmp_ok eval { $rs->find($row->id)->amount }, '==', 100,
+ 'money value round-trip';
lives_ok {
$row->update({ amount => 200 });
} 'updated a money value';
- is eval { $rs->find($row->id)->amount },
- 200, 'updated money value round-trip';
+ cmp_ok eval { $rs->find($row->id)->amount }, '==', 200,
+ 'updated money value round-trip';
lives_ok {
$row->update({ amount => undef });
lives_ok { $rs->create( { 'id' => $id, $type => $binstr{$size} } ) }
"inserted $size $type without dying";
- ok($rs->find($id)->$type eq $binstr{$size}, "verified inserted $size $type" );
+ my $got = $rs->find($id)->$type;
+
+ my $hexdump = sub { join '', map sprintf('%02X', ord), split //, shift };
+
+ ok($got eq $binstr{$size}, "verified inserted $size $type" )
+ or do {
+ diag "For " . (ref $schema->storage) . "\n";
+ diag "Got blob:\n";
+ diag $hexdump->(substr($got,0,50));
+ diag "Expecting blob:\n";
+ diag $hexdump->(substr($binstr{$size},0,50));
+ };
}
}
}