diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-04-06 16:36:40 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-04-06 16:36:40 -0400 |
| commit | 6d12f1dce744146dfa9072d574c540e1d49bb31b (patch) | |
| tree | 4ffc721508ba25a6f125147873446365820dd0ff /test/sets.tm | |
| parent | 2640c138b305b558bccf1d36f3f0d54fab96e84c (diff) | |
| parent | 52e50e58c6674560056a4dcb787099d739284b02 (diff) | |
Merge branch 'main' into no-colons
Diffstat (limited to 'test/sets.tm')
| -rw-r--r-- | test/sets.tm | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/test/sets.tm b/test/sets.tm index 1c395fba..fe2e91f8 100644 --- a/test/sets.tm +++ b/test/sets.tm @@ -1,39 +1,42 @@ func main() - >> t1 := @{10, 20, 30, 10} - = @{10, 20, 30} + >> t1 := @|10, 20, 30, 10| + = @|10, 20, 30| >> t1.has(10) = yes >> t1.has(-999) = no - >> t2 := {30, 40} + >> t2 := |30, 40| >> t1.with(t2) - >> {10, 20, 30, 40} + >> |10, 20, 30, 40| >> t1.without(t2) - >> {10, 20} + >> |10, 20| >> t1.overlap(t2) - >> {30} + >> |30| - >> {1,2}.is_subset_of({2,3}) + >> |1,2|.is_subset_of(|2,3|) = no - >> {1,2}.is_subset_of({1,2,3}) + >> |1,2|.is_subset_of(|1,2,3|) = yes - >> {1,2}.is_subset_of({1,2}) + >> |1,2|.is_subset_of(|1,2|) = yes - >> {1,2}.is_subset_of({1,2}, strict=yes) + >> |1,2|.is_subset_of(|1,2|, strict=yes) = no >> t1.add_all(t2) >> t1 - = @{10, 20, 30, 40} + = @|10, 20, 30, 40| >> t1.remove_all(t2) >> t1 - = @{10, 20} + = @|10, 20| - >> {3, i for i in 5} - = {3, 1, 2, 4, 5} + >> |3, i for i in 5| + = |3, 1, 2, 4, 5| + + >> empty : |Int| = || + = || |
