File: 02maybe.t

package info (click to toggle)
libperlx-maybe-perl 1.202-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 184 kB
  • sloc: perl: 155; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 426 bytes parent folder | download | duplicates (5)
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;

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 ],
	);