plan skip_all, 'Set $ENV{DBICTEST_MSSQL_DSN}, _USER and _PASS to run this test'\r
unless ($dsn);\r
\r
-plan tests => 1;\r
+plan tests => 4;\r
\r
-DBICTest::Schema->compose_connection('MSSQLTest' => $dsn, $user, $pass);\r
+DBICTest::Schema->compose_connection( 'MSSQLTest' => $dsn, $user, $pass );\r
\r
my $dbh = MSSQLTest::Artist->storage->dbh;\r
\r
\r
MSSQLTest::Artist->load_components('PK::Auto::MSSQL');\r
\r
-my $new = MSSQLTest::Artist->create({ name => 'foo' });\r
-\r
+# Test PK\r
+my $new = MSSQLTest::Artist->create( { name => 'foo' } );\r
ok($new->artistid, "Auto-PK worked");\r
\r
+# Test LIMIT\r
+for (1..6) {\r
+ MSSQLTest::Artist->create( { name => 'Artist ' . $_ } );\r
+}\r
+\r
+my $it = MSSQLTest::Artist->search( { },\r
+ { rows => 3,\r
+ offset => 2,\r
+ order_by => 'artistid'\r
+ }\r
+);\r
+\r
+is( $it->count, 3, "LIMIT count ok" );\r
+is( $it->next->name, "Artist 2", "iterator->next ok" );\r
+$it->next;\r
+$it->next;\r
+is( $it->next, undef, "next past end of resultset ok" );\r
+\r
1;\r