File: 10result.t

package info (click to toggle)
libtest-databaserow-perl 2.04-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 296 kB
  • ctags: 177
  • sloc: perl: 3,062; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 930 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
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/perl

########################################################################
# this test simply tests the Test::DatabaseRow::Result object
########################################################################

use strict;
use warnings;

use Test::More tests => 10;

BEGIN { use_ok("Test::DatabaseRow::Result") };


{
	my $result = Test::DatabaseRow::Result->new();
	isa_ok($result, "Test::DatabaseRow::Result");
	ok(!$result->is_error, "Not is_error");
	ok($result->is_success, "Is is_success");
	is_deeply($result->diag, [], "diag");
}
{
	my $result = Test::DatabaseRow::Result->new( is_error => 1, diag => [ "foo", "bar" ]);
	isa_ok($result, "Test::DatabaseRow::Result");
	ok($result->is_error, "Is is_error");
	ok(!$result->is_success, "Not is_success");
	is_deeply($result->diag, [ "foo", "bar" ], "diag");
	$result->add_diag("bazz","buzz");
	is_deeply($result->diag, [ "foo", "bar","bazz","buzz" ], "diag");
}