File: boolean.t

package info (click to toggle)
libtest-deep-perl 0.113-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 464 kB
  • ctags: 254
  • sloc: perl: 2,144; makefile: 2
file content (45 lines) | stat: -rw-r--r-- 668 bytes parent folder | download | duplicates (5)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
use strict;
use warnings;

use t::std;

{
	check_tests(
		sub {
			cmp_deeply(1, bool(1), "num 1");
			cmp_deeply("abds", bool(1), "string");
			cmp_deeply(0, bool(0), "num 0");
			cmp_deeply("", bool(0), "string");
		},
		[
			({
				actual_ok => 1,
				diag => "",
			}) x 4
		],
		"ok"
	);

	check_tests(
		sub {
			cmp_deeply(1, bool(0), "num 1");
			cmp_deeply("abds", bool(0), "string");
			cmp_deeply(0, bool(1), "num 0");
			cmp_deeply("", bool(1), "string");
		},
		[
			{
				actual_ok => 0,
				diag => <<EOM,
Comparing \$data as a boolean
   got : true ('1')
expect : false ('0')
EOM
			},
			({
				actual_ok => 0,
			}) x 3,
		],
		"string not eq"
	);
}