Skip to content

Commit

Permalink
Add some more (|) testing
Browse files Browse the repository at this point in the history
- lazy lists should be tested for any incarnation of (|)
- add tests for the union of 3 empty QuantHashes
  • Loading branch information
lizmat committed Jul 13, 2017
1 parent 0b142b8 commit 48fe31d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions S03-operators/set_union.t
Expand Up @@ -82,7 +82,7 @@ my @triplets =
42, 666, (42,666).Set,
;

plan 4 * (1 + 2 * @pairs/2 + 3 * @triplets/3) + 2 * @types;
plan 4 * (1 + 3 * @types + 2 * @pairs/2 + 3 * @triplets/3);

# union
for
Expand All @@ -94,6 +94,15 @@ for

is-deeply op(), set(), "does $name\() return set()";

for @types -> \qh {
is-deeply op(qh.new,qh.new,qh.new), ::(qh.^name.substr(0,3)).new,
"Sequence of empty {qh.^name} is the empty {qh.^name.substr(0,3)}";
throws-like { op(qh.new,^Inf) }, X::Cannot::Lazy,
"Cannot {qh.perl}.new (|) lazy list";
throws-like { op(qh.new(<a b c>),^Inf) }, X::Cannot::Lazy,
"Cannot {qh.perl}.new(<a b c>) (|) lazy list";
}

for @pairs -> $parameter, $result {
#exit dd $parameter, $result unless
is-deeply op($parameter.item), $result,
Expand All @@ -116,11 +125,4 @@ for
}
}

for @types -> \qh {
throws-like { qh.new (|) ^Inf }, X::Cannot::Lazy,
"Cannot {qh.perl}.new (|) lazy list";
throws-like { qh.new(<a b c>) (|) ^Inf }, X::Cannot::Lazy,
"Cannot {qh.perl}.new(<a b c>) (|) lazy list";
}

# vim: ft=perl6

0 comments on commit 48fe31d

Please sign in to comment.