Skip to content

Commit

Permalink
Streamline RT #131300 tests
Browse files Browse the repository at this point in the history
- don't use eval-lives-ok
  • Loading branch information
lizmat committed Oct 17, 2017
1 parent e53d219 commit b7c9f9a
Showing 1 changed file with 35 additions and 8 deletions.
43 changes: 35 additions & 8 deletions S02-types/set.t
Original file line number Diff line number Diff line change
Expand Up @@ -508,18 +508,45 @@ subtest '.hash does not cause keys to be stringified' => {

# RT #131300
subtest 'set ops do not hang with Setty/Baggy/Mixy type objects' => {
my @ops := Β«
∈ (elem) βˆ‰ !(elem) βˆ‹ (cont) ∌ !(cont) βŠ† (<=) ⊈ !(<=)
βŠ‚ (<) βŠ„ !(<) βŠ‡ (>=) βŠ‰ !(>=) βŠƒ (>) βŠ… !(>)
βˆͺ (|) ∩ (&) βˆ– (-) βŠ– (^) ⊍ (.) ⊎ (+)
Β»;
my @ops =
&infix:<<∈>>, '∈',
&infix:<<(elem)>>, '(elem)',
&infix:<<βˆ‰>>, 'βˆ‰',
&infix:<<βˆ‹>>, 'βˆ‹',
&infix:<<(cont)>>, '(cont)',
&infix:<<∌>>, '∌',
&infix:<<βŠ†>>, 'βŠ†',
&infix:<<(<=)>>, '(<=)',
&infix:<<⊈>>, '⊈',
&infix:<<βŠ‚>>, 'βŠ‚',
&infix:<<(<)>>, '(<)',
&infix:<<βŠ„>>, 'βŠ„',
&infix:<<βŠ‡>>, 'βŠ‡',
&infix:<<(>=)>>, '(>=)',
&infix:<<βŠ‰>>, 'βŠ‰',
&infix:<<βŠƒ>>, 'βŠƒ',
&infix:<<(>)>>, '(>)',
&infix:<<βŠ…>>, 'βŠ…',
&infix:<<βˆͺ>>, 'βˆͺ',
&infix:<<(|)>>, '(|)',
&infix:<<∩>>, '∩',
&infix:<<(&)>>, '(&)',
&infix:<<βˆ–>>, 'βˆ– ',
&infix:<<(-)>>, '(-)',
&infix:<<βŠ–>>, 'βŠ–',
&infix:<<(^)>>, '(^)',
&infix:<<⊍>>, '⊍',
&infix:<<(.)>>, '(.)',
&infix:<<⊎>>, '⊎',
&infix:<<(+)>>, '(+)',
;

my @types := Set, SetHash, Bag, BagHash, Mix, MixHash;
plan @ops Γ— @types;
plan @ops Γ· 2 Γ— @types;

for @types -> $type {
for @ops {
eval-lives-ok "\$ = 1 $_ $type.perl()", "$type.perl() $_";
for @ops -> &op, $name {
lives-ok { op($ = 1, $type) }, "$type.perl() $name";
}
}
}
Expand Down

0 comments on commit b7c9f9a

Please sign in to comment.