] ] }
);
-cmp_ok( $rs + 0, '==', 1, "Single record in resultset");
+is( $rs + 0, 1, "Single record in resultset");
is($rs->first->title, 'Forkful of bees', 'Correct record returned');
{ 'year' => 2001, 'artist.name' => 'Caterwauler McCrae' },
{ join => 'artist' });
-cmp_ok( $rs + 0, '==', 1, "Single record in resultset");
+is( $rs + 0, 1, "Single record in resultset");
is($rs->first->title, 'Forkful of bees', 'Correct record returned');
'liner_notes.notes' => 'Kill Yourself!' },
{ join => [ qw/artist liner_notes/ ] });
-cmp_ok( $rs + 0, '==', 1, "Single record in resultset");
+is( $rs + 0, 1, "Single record in resultset");
is($rs->first->title, 'Come Be Depressed With Us', 'Correct record returned');
{ 'artist' => 1 },
{ join => [qw/artist/], order_by => 'artist.name' }
);
-cmp_ok( scalar $rs->all, '==', scalar $rs->slice(0, $rs->count - 1), 'slice() with join has same count as all()' );
+is( scalar $rs->all, scalar $rs->slice(0, $rs->count - 1), 'slice() with join has same count as all()' );
ok(!$rs->slice($rs->count+1000, $rs->count+1002)->count,
'Slicing beyond end of rs returns a zero count');
{ 'liner_notes.notes' => 'Kill Yourself!' },
{ join => { 'cds' => 'liner_notes' } });
-cmp_ok( $rs->count, '==', 1, "Single record in resultset");
+is( $rs->count, 1, "Single record in resultset");
is($rs->first->name, 'We Are Goth', 'Correct record returned');
return $schema->resultset("TwoKeys")->count;
}
- cmp_ok(cd_count(), '==', 8, '8 rows in table cd');
- cmp_ok(tk_count(), '==', 7, '7 rows in table twokeys');
+ is(cd_count(), 8, '8 rows in table cd');
+ is(tk_count(), 7, '7 rows in table twokeys');
sub artist1 {
return $schema->resultset("CD")->search(
);
}
- cmp_ok( artist1()->count, '==', 3, '3 Caterwauler McCrae CDs' );
+ is( artist1()->count, 3, '3 Caterwauler McCrae CDs' );
ok( artist1()->delete, 'Successfully deleted 3 CDs' );
- cmp_ok( artist1()->count, '==', 0, '0 Caterwauler McCrae CDs' );
- cmp_ok( artist2()->count, '==', 2, '3 Random Boy Band CDs' );
+ is( artist1()->count, 0, '0 Caterwauler McCrae CDs' );
+ is( artist2()->count, 2, '3 Random Boy Band CDs' );
ok( artist2()->update( { 'artist' => 1 } ) );
- cmp_ok( artist2()->count, '==', 0, '0 Random Boy Band CDs' );
- cmp_ok( artist1()->count, '==', 2, '2 Caterwauler McCrae CDs' );
+ is( artist2()->count, 0, '0 Random Boy Band CDs' );
+ is( artist1()->count, 2, '2 Caterwauler McCrae CDs' );
# test update on multi-column-pk
sub tk1 {
{ join => [qw/artist/]}
);
}
- cmp_ok( tk2()->count, '==', 2, 'TwoKeys count == 2' );
- cmp_ok( tk1()->count, '==', 2, 'TwoKeys count == 2' );
+ is( tk2()->count, 2, 'TwoKeys count == 2' );
+ is( tk1()->count, 2, 'TwoKeys count == 2' );
ok( tk1()->update( { artist => 1 } ) );
- cmp_ok( tk1()->count, '==', 0, 'TwoKeys count == 0' );
- cmp_ok( tk2()->count, '==', 4, '2 Caterwauler McCrae CDs' );
+ is( tk1()->count, 0, 'TwoKeys count == 0' );
+ is( tk2()->count, 4, '2 Caterwauler McCrae CDs' );
ok( tk2()->delete, 'Successfully deleted 4 CDs' );
- cmp_ok(cd_count(), '==', 5, '5 rows in table cd');
- cmp_ok(tk_count(), '==', 3, '3 rows in table twokeys');
+ is(cd_count(), 5, '5 rows in table cd');
+ is(tk_count(), 3, '3 rows in table twokeys');
}