File: results-exist.t

package info (click to toggle)
libdbix-class-helpers-perl 2.023007-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 792 kB
  • ctags: 294
  • sloc: perl: 3,872; sql: 161; makefile: 7
file content (19 lines) | stat: -rw-r--r-- 429 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!perl

use strict;
use warnings;

use lib 't/lib';
use Test::More;

use TestSchema;
my $schema = TestSchema->deploy_or_connect();
$schema->prepopulate;

my $rs = $schema->resultset( 'Foo' )->search({ id => { '>' => 0 } });
my $rs2 = $schema->resultset( 'Foo' )->search({ id => { '<' => 0 } });

ok( $rs->results_exist, 'check rs has some results' );
ok(!$rs2->results_exist, 'and check that rs has no results' );

done_testing;