Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Start of set operators test.
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| use v6; | ||
| use Test; | ||
|
|
||
| plan 4; | ||
|
|
||
| sub showset($s) { $s.keys.sort.join(' ') } | ||
|
|
||
| my $s = set <I'm afraid it isn't your day>; | ||
| my $ks = KeySet.new(<I'm afraid it is>); # Tom Stoppard | ||
| my $b = bag <Whoever remains for long here in this earthly life will enjoy and endure more than enough>; # Seamus Heaney | ||
| my $kb = KeyBag.new(<None of us have all the heaven we want>); # Donald McCaig | ||
|
|
||
| ok "afraid" ∈ $s, "afraid is an element of Set"; | ||
| ok "afraid" ∈ $ks, "afraid is an element of KeySet"; | ||
| ok "earthly" ∈ $b, "earthly is an element of Bag"; | ||
| ok "heaven" ∈ $kb, "heaven is an element of KeyBag"; | ||
|
|
||
| # vim: ft=perl6 |