X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fsearch%2Fpreserve_original_rs.t;h=15fdb8d8800c25845ec0215b205b50caeb283a41;hb=1887cd9f0db6e10e4659fa770b064e2bf25bc0b3;hp=8896b48e805895aaf070f25fb0e13c3f892263f4;hpb=f390d66dabd6359ebe778a1e993956de122e1b85;p=dbsrgits%2FDBIx-Class.git diff --git a/t/search/preserve_original_rs.t b/t/search/preserve_original_rs.t index 8896b48..15fdb8d 100644 --- a/t/search/preserve_original_rs.t +++ b/t/search/preserve_original_rs.t @@ -86,4 +86,17 @@ for my $s (qw/a2a artw cd artw_back/) { is_same_sql_bind ($rs->as_query, $q{$s}{query}, "$s resultset unmodified (as_query matches)" ); } +# ensure nothing pollutes the attrs of an existing rs +{ + my $fresh = $schema->resultset('CD'); + + isa_ok ($fresh->find(1), 'DBICTest::CD' ); + isa_ok ($fresh->single({ cdid => 1}), 'DBICTest::CD' ); + isa_ok ($fresh->search({ cdid => 1})->next, 'DBICTest::CD' ); + is ($fresh->count({ cdid => 1}), 1 ); + is ($fresh->count_rs({ cdid => 1})->next, 1 ); + + ok (! exists $fresh->{_attrs}{_sqlmaker_select_args}, 'select args did not leak through' ); +} + done_testing;