use warnings;
use Test::More tests => 14;
+use Test::Deep;
BEGIN {
use_ok('MooseX::Storage');
);
isa_ok( $foo, 'Foo' );
- is_deeply(
+ cmp_deeply(
$foo->pack,
{
__CLASS__ => 'Foo',
is( $foo->string, 'foo', '... got the right string' );
ok( $foo->boolean, '... got the right boolean' );
is( $foo->float, 10.5, '... got the right float' );
- is_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' );
- is_deeply(
+ cmp_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' );
+ cmp_deeply(
$foo->hash,
{ map { $_ => undef } ( 1 .. 10 ) },
'... got the right hash'
isa_ok( $foo->object, 'Foo' );
is( $foo->object->number, 2,
'... got the right number (in the embedded object)' );
- is_deeply( $foo->union, [ 1 .. 3 ], '... got the right array (in the union)' );
+ cmp_deeply( $foo->union, [ 1 .. 3 ], '... got the right array (in the union)' );
is( $foo->union2, 'A String', '... got the right string (in the union)' );
}
use warnings;
use Test::More;
+use Test::Deep;
use File::Temp qw(tempdir);
use File::Spec::Functions;
is($foo->number, 10, '... got the right number');
is($foo->string, 'foo', '... got the right string');
is($foo->float, 10.5, '... got the right float');
- is_deeply($foo->array, [ 1 .. 10], '... got the right array');
- is_deeply($foo->hash, { map { $_ => undef } (1 .. 10) }, '... got the right hash');
+ cmp_deeply($foo->array, [ 1 .. 10], '... got the right array');
+ cmp_deeply($foo->hash, { map { $_ => undef } (1 .. 10) }, '... got the right hash');
isa_ok($foo->object, 'Foo');
is($foo->object->number, 2, '... got the right number (in the embedded object)');
use warnings;
use Test::More tests => 11;
+use Test::Deep;
BEGIN {
use_ok('MooseX::Storage');
);
isa_ok( $foo, 'Foo' );
- is_deeply(
+ cmp_deeply(
$foo->pack,
{
__CLASS__ => 'Foo',
is( $foo->number, 10, '... got the right number' );
is( $foo->string, 'foo', '... got the right string' );
is( $foo->float, 10.5, '... got the right float' );
- is_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' );
- is_deeply(
+ cmp_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' );
+ cmp_deeply(
$foo->hash,
{ map { $_ => undef } ( 1 .. 10 ) },
'... got the right hash'
use warnings;
use Test::More tests => 47;
+use Test::Deep;
BEGIN {
use_ok('MooseX::Storage');
);
isa_ok( $foo, 'Foo' );
- is_deeply(
+ cmp_deeply(
$foo->pack,
{
__CLASS__ => 'Foo',
);
isa_ok( $baz, 'Baz' );
- is_deeply(
+ cmp_deeply(
$baz->pack,
{
__CLASS__ => 'Baz',
use warnings;
use Test::More tests => 18;
+use Test::Deep;
use Test::Fatal;
BEGIN {
my $t = Tree->new(node => 100);
isa_ok($t, 'Tree');
- is_deeply(
+ cmp_deeply(
$t->pack,
{
__CLASS__ => 'Tree',
$t->add_child($t2);
- is_deeply($t->children, [ $t2 ], '... got the right children in $t');
+ cmp_deeply($t->children, [ $t2 ], '... got the right children in $t');
is($t2->parent, $t, '... created the cycle correctly');
isa_ok($t2->parent, 'Tree');
- is_deeply(
+ cmp_deeply(
$t->pack,
{
__CLASS__ => 'Tree',
},
'... got the right packed version (with parent attribute skipped in child)');
- is_deeply(
+ cmp_deeply(
$t2->pack,
{
__CLASS__ => 'Tree',
use warnings;
use Test::More tests => 8;
+use Test::Deep;
use Test::Fatal;
BEGIN {
);
isa_ok( $foo, 'Foo' );
- is_deeply(
+ cmp_deeply(
$foo->pack,
{
__CLASS__ => 'Foo-0.01-cpan:JRANDOM',
use warnings;
use Test::More tests => 9;
+use Test::Deep;
use Test::Fatal;
BEGIN {
isa_ok($foo->bar, 'Bar');
-is_deeply(
+cmp_deeply(
$foo->pack,
{
__CLASS__ => "Foo",
use warnings;
use Test::More tests => 8;
+use Test::Deep;
BEGIN {
use_ok('MooseX::Storage');
is($foo->boolean, 0, '... got the right boolean value');
- is_deeply(
+ cmp_deeply(
$foo->pack,
{
__CLASS__ => 'Foo',
use warnings;
use Test::More tests => 13;
+use Test::Deep;
use Test::Fatal;
BEGIN {
is($foo->baz, 'BAZ', '... got the value we expected');
is($foo->gorch, 'GORCH', '... got the value we expected');
- is_deeply(
+ cmp_deeply(
$foo->pack,
{
__CLASS__ => 'Foo',
is( $bar->zot, $$, " ->zot => $$" );
my $bpack = $bar->pack;
- is_deeply(
+ cmp_deeply(
$bpack,
{ __CLASS__ => 'Bar',
zot => $$,
use warnings;
use Test::More 'no_plan';#tests => 6;
+use Test::Deep;
use Test::Fatal;
BEGIN {
is( $href->{'z'}, 'z', " z => z" );
ok( not(exists($href->{'y'})), " y does not exist" );
-is_deeply(
+cmp_deeply(
$href,
{ '__CLASS__' => 'Point',
'x' => $$,
use warnings;
use Test::More;
+use Test::Deep;
use Test::Requires {
'Test::JSON' => 0.01, # skip all if not installed
is( $foo->number, 10, '... got the right number' );
is( $foo->string, 'foo', '... got the right string' );
is( $foo->float, 10.5, '... got the right float' );
- is_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' );
- is_deeply(
+ cmp_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' );
+ cmp_deeply(
$foo->hash,
{ map { $_ => undef } ( 1 .. 10 ) },
'... got the right hash'
use warnings;
use Test::More;
+use Test::Deep;
use Test::Requires {
'MooseX::Storage::Format::JSONpm' => 0.01, # skip all if not installed
my $json = eval { Bar->new(x => 10, y => 20)->freeze({ format => $p }) };
- is_deeply(
+ cmp_deeply(
JSON->new->decode($json),
{
'__CLASS__' => 'Bar-0.01',
use warnings;
use Test::More;
+use Test::Deep;
use Test::Requires {
'YAML::Any' => 0.01, # skip all if not installed
is( $bar->number, 10, '... got the right number' );
is( $bar->string, 'foo', '... got the right string' );
is( $bar->float, 10.5, '... got the right float' );
- is_deeply( $bar->array, [ 1 .. 10 ], '... got the right array' );
- is_deeply(
+ cmp_deeply( $bar->array, [ 1 .. 10 ], '... got the right array' );
+ cmp_deeply(
$bar->hash,
{ map { $_ => undef } ( 1 .. 10 ) },
'... got the right hash'
use warnings;
use Test::More;
+use Test::Deep;
use Test::Requires {
'YAML::Any' => 0.01, # skip all if not installed
is( $bar->number, 10, '... got the right number' );
is( $bar->string, 'foo', '... got the right string' );
is( $bar->float, 10.5, '... got the right float' );
- is_deeply( $bar->array, [ 1 .. 10 ], '... got the right array' );
- is_deeply(
+ cmp_deeply( $bar->array, [ 1 .. 10 ], '... got the right array' );
+ cmp_deeply(
$bar->hash,
{ map { $_ => undef } ( 1 .. 10 ) },
'... got the right hash'
use warnings;
use Test::More;
+use Test::Deep;
use Test::Requires {
'YAML::Any' => 0.01, # skip all if not installed
is( $bar->number, 10, '... got the right number' );
is( $bar->string, 'foo', '... got the right string' );
is( $bar->float, 10.5, '... got the right float' );
- is_deeply( $bar->array, [ 1 .. 10 ], '... got the right array' );
- is_deeply(
+ cmp_deeply( $bar->array, [ 1 .. 10 ], '... got the right array' );
+ cmp_deeply(
$bar->hash,
{ map { $_ => undef } ( 1 .. 10 ) },
'... got the right hash'
use warnings;
use Test::More tests => 11;
+use Test::Deep;
use Storable;
BEGIN {
my $stored = $foo->freeze;
my $struct = Storable::thaw($stored);
- is_deeply(
+ cmp_deeply(
$struct,
{
'__CLASS__' => 'Foo',
is( $foo->number, 10, '... got the right number' );
is( $foo->string, 'foo', '... got the right string' );
is( $foo->float, 10.5, '... got the right float' );
- is_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' );
- is_deeply(
+ cmp_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' );
+ cmp_deeply(
$foo->hash,
{ map { $_ => undef } ( 1 .. 10 ) },
'... got the right hash'
use warnings;
use Test::More;
+use Test::Deep;
use Storable;
use Test::Requires {
is( $foo->number, 10, '... got the right number' );
is( $foo->string, 'foo', '... got the right string' );
is( $foo->float, 10.5, '... got the right float' );
- is_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' );
- is_deeply(
+ cmp_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' );
+ cmp_deeply(
$foo->hash,
{ map { $_ => undef } ( 1 .. 10 ) },
'... got the right hash'
my $stored = $foo->freeze({ 'format' => 'Storable' });
my $struct = Storable::thaw($stored);
- is_deeply(
+ cmp_deeply(
$struct,
{
'__CLASS__' => 'Foo',
is( $foo->number, 10, '... got the right number' );
is( $foo->string, 'foo', '... got the right string' );
is( $foo->float, 10.5, '... got the right float' );
- is_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' );
- is_deeply(
+ cmp_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' );
+ cmp_deeply(
$foo->hash,
{ map { $_ => undef } ( 1 .. 10 ) },
'... got the right hash'
is( $bar->number, 10, '... got the right number' );
is( $bar->string, 'foo', '... got the right string' );
is( $bar->float, 10.5, '... got the right float' );
- is_deeply( $bar->array, [ 1 .. 10 ], '... got the right array' );
- is_deeply(
+ cmp_deeply( $bar->array, [ 1 .. 10 ], '... got the right array' );
+ cmp_deeply(
$bar->hash,
{ map { $_ => undef } ( 1 .. 10 ) },
'... got the right hash'
use warnings;
use Test::More;
+use Test::Deep;
use File::Temp qw(tempdir);
use File::Spec::Functions;
is($foo->number, 10, '... got the right number');
is($foo->string, 'foo', '... got the right string');
is($foo->float, 10.5, '... got the right float');
- is_deeply($foo->array, [ 1 .. 10], '... got the right array');
- is_deeply($foo->hash, { map { $_ => undef } (1 .. 10) }, '... got the right hash');
+ cmp_deeply($foo->array, [ 1 .. 10], '... got the right array');
+ cmp_deeply($foo->hash, { map { $_ => undef } (1 .. 10) }, '... got the right hash');
isa_ok($foo->object, 'Foo');
is($foo->object->number, 2, '... got the right number (in the embedded object)');
is($foo->number, 10, '... got the right number');
is($foo->string, 'foo', '... got the right string');
is($foo->float, 10.5, '... got the right float');
- is_deeply($foo->array, [ 1 .. 10], '... got the right array');
- is_deeply($foo->hash, { map { $_ => undef } (1 .. 10) }, '... got the right hash');
+ cmp_deeply($foo->array, [ 1 .. 10], '... got the right array');
+ cmp_deeply($foo->hash, { map { $_ => undef } (1 .. 10) }, '... got the right hash');
isa_ok($foo->object, 'Foo');
is($foo->object->number, 2, '... got the right number (in the embedded object)');
use warnings;
use Test::More tests => 22;
+use Test::Deep;
BEGIN {
use_ok('MooseX::Storage');
);
isa_ok( $foo, 'Foo' );
- is_deeply(
+ cmp_deeply(
$foo->pack,
{
__CLASS__ => 'Foo',
is( $foo->string, 'foo', '... got the right string' );
ok( $foo->boolean, '... got the right boolean' );
is( $foo->float, 10.5, '... got the right float' );
- is_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' );
- is_deeply(
+ cmp_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' );
+ cmp_deeply(
$foo->hash,
{ map { $_ => undef } ( 1 .. 10 ) },
'... got the right hash'
);
isa_ok( $foo, 'Foo' );
- is_deeply(
+ cmp_deeply(
$foo->pack,
{
__CLASS__ => 'Foo',
is( $foo->number, 10, '... got the right number' );
is( $foo->string, 'foo', '... got the right string' );
is( $foo->float, 10.5, '... got the right float' );
- is_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' );
- is_deeply(
+ cmp_deeply( $foo->array, [ 1 .. 10 ], '... got the right array' );
+ cmp_deeply(
$foo->hash,
{ map { $_ => undef } ( 1 .. 10 ) },
'... got the right hash'
use warnings;
use Test::More;
+use Test::Deep;
use File::Temp qw(tempdir);
use File::Spec::Functions;
my $dir = tempdir;
is($foo->number, 10, '... got the right number');
is($foo->string, 'foo', '... got the right string');
is($foo->float, 10.5, '... got the right float');
- is_deeply($foo->array, [ 1 .. 10], '... got the right array');
- is_deeply($foo->hash, { map { $_ => undef } (1 .. 10) }, '... got the right hash');
+ cmp_deeply($foo->array, [ 1 .. 10], '... got the right array');
+ cmp_deeply($foo->hash, { map { $_ => undef } (1 .. 10) }, '... got the right hash');
isa_ok($foo->object, 'Foo');
is($foo->object->number, 2, '... got the right number (in the embedded object)');
use warnings;
use Test::More;
+use Test::Deep;
use File::Temp qw(tempdir);
use File::Spec::Functions;
my $dir = tempdir( CLEANUP => 1 );
is($foo->number, 10, '... got the right number');
is($foo->string, 'foo', '... got the right string');
is($foo->float, 10.5, '... got the right float');
- is_deeply($foo->array, [ 1 .. 10], '... got the right array');
- is_deeply($foo->hash, { map { $_ => undef } (1 .. 10) }, '... got the right hash');
+ cmp_deeply($foo->array, [ 1 .. 10], '... got the right array');
+ cmp_deeply($foo->hash, { map { $_ => undef } (1 .. 10) }, '... got the right hash');
isa_ok($foo->object, 'Foo');
is($foo->object->number, 2, '... got the right number (in the embedded object)');
use warnings;
use Test::More tests => 10;
+use Test::Deep;
use File::Temp qw(tempdir);
use File::Spec::Functions;
my $dir = tempdir( CLEANUP => 1 );
is($foo->number, 10, '... got the right number');
is($foo->string, 'foo', '... got the right string');
is($foo->float, 10.5, '... got the right float');
- is_deeply($foo->array, [ 1 .. 10], '... got the right array');
- is_deeply($foo->hash, { map { $_ => undef } (1 .. 10) }, '... got the right hash');
+ cmp_deeply($foo->array, [ 1 .. 10], '... got the right array');
+ cmp_deeply($foo->hash, { map { $_ => undef } (1 .. 10) }, '... got the right hash');
isa_ok($foo->object, 'Foo');
is($foo->object->number, 2, '... got the right number (in the embedded object)');
use warnings;
use Test::More tests => 11;
+use Test::Deep;
use Storable ();
use File::Temp qw(tempdir);
use File::Spec::Functions;
# check our custom freeze hook fired ...
my $data = Storable::retrieve($file);
- is_deeply(
+ cmp_deeply(
$data,
{
'__CLASS__' => 'Foo',
is($foo->number, 10, '... got the right number');
is($foo->float, 10.5, '... got the right float');
- is_deeply($foo->array, [ 1 .. 10], '... got the right array');
- is_deeply($foo->hash, { map { $_ => undef } (1 .. 10) }, '... got the right hash');
+ cmp_deeply($foo->array, [ 1 .. 10], '... got the right array');
+ cmp_deeply($foo->hash, { map { $_ => undef } (1 .. 10) }, '... got the right hash');
isa_ok($foo->object, 'Foo');
is($foo->object->number, 2, '... got the right number (in the embedded object)');