Debian Codegraph @

t/21-row_by_pk-exception.t

raw symbols SCIP
1 #!/usr/bin/perl -w
2
3 use strictscip-perl cpan Alzabo 0.92 strict/;
4
5 use File::Specscip-perl cpan Alzabo 0.92 File/Spec/;
6
7 use libscip-perl cpan Alzabo 0.92 lib/ '.', File::Spec->catdir( File::Spec->curdir, 't', 'lib' );
8
9 use Alzabo::Runtimescip-perl cpan Alzabo 0.92 Alzabo/Runtime/;
10 use Alzabo::Test::Utilsscip-perl cpan Alzabo 0.92 Alzabo/Test/Utils/;
11
12 use Test::Morescip-perl cpan Alzabo 0.92 Test/More/;
13
14 Alzabo::Test::Utils->remove_all_schemasscip-perl cpan Alzabo 0.92 Alzabo/Test/Utils/remove_all_schemas().;
15
16 my $schema = Alzabo::Test::Utils->any_connected_runtime_schemascip-perl cpan Alzabo 0.92 Alzabo/Test/Utils/any_connected_runtime_schema().;
17
18 if ($schema)
19 {
20 planscip-perl cpan Alzabo 0.92 main/plan(). tests => 2;
21 }
22 else
23 {
24 planscip-perl cpan Alzabo 0.92 main/plan(). skip_all => 'no test config provided';
25 exitscip-perl cpan Alzabo 0.92 main/exit().;
26 }
27
28 my $emp_t = $schema->tablescip-perl cpan Alzabo 0.92 Alzabo/Test/Utils/table().('employee');
29
30 # value of pk is irrelevant, as long as it doesn't exist
31 my $row = eval { $emp_t->row_by_pkscip-perl cpan Alzabo 0.92 main/row_by_pk().( pk => 1258125 ) };
32
33 isscip-perl cpan Alzabo 0.92 main/is().( $row, undef, 'no row matched the given pk' );
34 isscip-perl cpan Alzabo 0.92 main/is().( $@scip-perl cpan Alzabo 0.92 main/`$@`., '', 'no exception was thrown with invalid pk' );