aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-06 16:36:40 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-06 16:36:40 -0400
commit6d12f1dce744146dfa9072d574c540e1d49bb31b (patch)
tree4ffc721508ba25a6f125147873446365820dd0ff /test
parent2640c138b305b558bccf1d36f3f0d54fab96e84c (diff)
parent52e50e58c6674560056a4dcb787099d739284b02 (diff)
Merge branch 'main' into no-colons
Diffstat (limited to 'test')
-rw-r--r--test/enums.tm2
-rw-r--r--test/optionals.tm4
-rw-r--r--test/serialization.tm4
-rw-r--r--test/sets.tm31
-rw-r--r--test/structs.tm4
-rw-r--r--test/tables.tm4
6 files changed, 26 insertions, 23 deletions
diff --git a/test/enums.tm b/test/enums.tm
index 3b3b31ea..901298a8 100644
--- a/test/enums.tm
+++ b/test/enums.tm
@@ -42,7 +42,7 @@ func main()
= yes
>> x := Foo.One(123)
- >> t := {x}
+ >> t := |x|
>> t.has(x)
= yes
>> t.has(Foo.Zero)
diff --git a/test/optionals.tm b/test/optionals.tm
index 1ec3c415..5344848d 100644
--- a/test/optionals.tm
+++ b/test/optionals.tm
@@ -245,8 +245,8 @@ func main()
= no
>> (5? == 5?)
= yes
- >> nones : {Int?} = {none, none}
- >> also_nones : {Int?} = {none}
+ >> nones : |Int?| = |none, none|
+ >> also_nones : |Int?| = |none|
>> nones == also_nones
>> [5?, none, none, 6?].sorted()
= [none, none, 5, 6]
diff --git a/test/serialization.tm b/test/serialization.tm
index 457442e5..258282c1 100644
--- a/test/serialization.tm
+++ b/test/serialization.tm
@@ -76,9 +76,9 @@ func main()
= yes
do
- >> obj := {10, 20, 30}
+ >> obj := |10, 20, 30|
>> bytes := obj.serialized()
- >> deserialize(bytes -> {Int}) == obj
+ >> deserialize(bytes -> |Int|) == obj
= yes
do
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| = ||
+ = ||
diff --git a/test/structs.tm b/test/structs.tm
index f1ae49d0..c340f1c9 100644
--- a/test/structs.tm
+++ b/test/structs.tm
@@ -32,7 +32,7 @@ func test_metamethods()
>> x < Pair(11, 20)
= yes
- >> set := {x}
+ >> set := |x|
>> set.has(x)
= yes
>> set.has(y)
@@ -49,7 +49,7 @@ func test_mixed()
= no
>> x < Mixed(11, "Hello")
= yes
- >> set := {x}
+ >> set := |x|
>> set.has(x)
= yes
>> set.has(y)
diff --git a/test/tables.tm b/test/tables.tm
index 67299142..9419d875 100644
--- a/test/tables.tm
+++ b/test/tables.tm
@@ -99,8 +99,8 @@ func main()
>> ints : [{Int=Int}] = [{}, {0=0}, {99=99}, {1=1, 2=2, 3=3}, {1=1, 99=99, 3=3}, {1=1, 2=-99, 3=3}, {1=1, 99=-99, 3=4}].sorted()
= [{}, {0=0}, {1=1, 2=-99, 3=3}, {1=1, 2=2, 3=3}, {1=1, 99=99, 3=3}, {1=1, 99=-99, 3=4}, {99=99}]
- >> other_ints : [{Int}] = [{/}, {1}, {2}, {99}, {0, 3}, {1, 2}, {99}].sorted()
- = [{/}, {0, 3}, {1}, {1, 2}, {2}, {99}, {99}]
+ >> other_ints : [|Int|] = [||, |1|, |2|, |99|, |0, 3|, |1, 2|, |99|].sorted()
+ = [||, |0, 3|, |1|, |1, 2|, |2|, |99|, |99|]
do
# Default values: