X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F100populate.t;h=f8c6f10dd889701920b911d613abde0bd1cea1a8;hb=cfa136aa2c08cfc19e7ef47e6cb1bccd8469e813;hp=c2c94918f7591434f16760afab219651005790b8;hpb=d6170b26eb0505a440a70c66ecd74c6df18ea2c1;p=dbsrgits%2FDBIx-Class.git diff --git a/t/100populate.t b/t/100populate.t index c2c9491..f8c6f10 100644 --- a/t/100populate.t +++ b/t/100populate.t @@ -6,6 +6,7 @@ use Test::Exception; use lib qw(t/lib); use DBICTest; use Path::Class::File (); +use List::Util qw/shuffle/; my $schema = DBICTest->init_schema(); @@ -18,10 +19,10 @@ my $schema = DBICTest->init_schema(); # [ 10000, "ntn" ], my $start_id = 'populateXaaaaaa'; -my $rows = 10; +my $rows = 10_000; my $offset = 3; -$schema->populate('Artist', [ [ qw/artistid name/ ], map { [ ($_ + $offset) => $start_id++ ] } ( 1 .. $rows ) ] ); +$schema->populate('Artist', [ [ qw/artistid name/ ], map { [ ($_ + $offset) => $start_id++ ] } shuffle ( 1 .. $rows ) ] ); is ( $schema->resultset ('Artist')->search ({ name => { -like => 'populateX%' } })->count, $rows, @@ -44,7 +45,7 @@ throws_ok ( sub { } } ('Huey', 'Dewey', $ex_title, 'Louie') ]) -}, qr/columns .+ are not unique for populate slice.+$ex_title/ms, 'Readable exception thrown for failed populate'); +}, qr/\Qexecute_array() aborted with '\E.+ at populate slice.+$ex_title/ms, 'Readable exception thrown for failed populate'); ## make sure populate honors fields/orders in list context ## schema order @@ -170,7 +171,7 @@ throws_ok { name => 'foo3', }, ]); -} qr/slice/, 'bad slice'; +} qr/\Qexecute_array() aborted with 'datatype mismatch\E\b/, 'bad slice'; is($rs->count, 0, 'populate is atomic'); @@ -188,7 +189,7 @@ throws_ok { name => \"'foo'", } ]); -} qr/bind expected/, 'literal sql where bind expected throws'; +} qr/Literal SQL found where a plain bind value is expected/, 'literal sql where bind expected throws'; # ... and vice-versa. @@ -203,7 +204,7 @@ throws_ok { name => \"'foo'", } ]); -} qr/literal SQL expected/i, 'bind where literal sql expected throws'; +} qr/\QIncorrect value (expecting SCALAR-ref/, 'bind where literal sql expected throws'; throws_ok { $rs->populate([ @@ -216,7 +217,7 @@ throws_ok { name => \"'bar'", } ]); -} qr/inconsistent/, 'literal sql must be the same in all slices'; +} qr/Inconsistent literal SQL value/, 'literal sql must be the same in all slices'; # the stringification has nothing to do with the artist name # this is solely for testing consistency