File: 02maybe.t

package info (click to toggle)
libperlx-maybe-xs-perl 1.001-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 348 kB
  • sloc: pascal: 33; perl: 16; makefile: 3
file content (18 lines) | stat: -rw-r--r-- 430 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use Test::More tests => 3;
use PerlX::Maybe::XS;

is_deeply(
	[ maybe foo => undef, maybe bar => 0, maybe baz => 1, undef ],
	[ bar => 0, baz => 1, undef ],
	);

is_deeply(
	[ 3, maybe foo => undef, 4, maybe bar => 0, 5, maybe baz => 1 ],
	[ 3, 4, bar => 0, 5, baz => 1 ],
	);

is_deeply(
	[ 3, maybe foo => {quux=>1}, undef, 4, maybe bar => 0, 5, maybe baz => 1 ],
	[ 3, foo => {quux=>1}, undef, 4, bar => 0, 5, baz => 1 ],
	);