X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F10-hashref.t;fp=t%2F10-hashref.t;h=90b108384acb095604f45f9323cf82e2377a5462;hb=698b98d027c36b44ec4e6c8b9065b6b95386bd61;hp=b1ebe9b1ebb8a6c5083f8a23b91bea5c25425f84;hpb=6c40f8c4712deb962c2c7db5a2aa7fb468dcd6f6;p=dbsrgits%2FDBIx-Class-ResultSet-HashRef.git diff --git a/t/10-hashref.t b/t/10-hashref.t index b1ebe9b..90b1083 100644 --- a/t/10-hashref.t +++ b/t/10-hashref.t @@ -10,7 +10,7 @@ BEGIN { eval "use SQL::Translator ();"; plan skip_all => 'SQL::Translator required to run this test' if $@; - plan( tests => 10 ); + plan( tests => 11 ); } use lib 't/lib'; @@ -312,3 +312,37 @@ foreach my $user (@users) { "hashref_first" ); } + +{ + my $hashref = $schema->resultset('User')->search( {}, { order_by => 'me.id ASC' } )->hashref_pk; + is_deeply( + $hashref, + { + 1 => { + 'id' => '1', + 'login' => 'root' + }, + 2 => { + 'id' => '2', + 'login' => 'toor' + }, + 3 => { + 'id' => '3', + 'login' => 'daemon' + }, + 4 => { + 'id' => '4', + 'login' => 'operator' + }, + 5 => { + 'id' => '5', + 'login' => 'bin' + }, + 6 => { + 'id' => '6', + 'login' => 'tty' + } + }, + 'hashref_pk' + ); +}