aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-09-13 12:01:52 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-09-13 12:01:52 -0400
commit981da7f0c6c47f66120482e7a7885cb5719d6959 (patch)
treec0d5bf912e7e477a0486120b8ac4aea8c49833f9 /test
parent3a8841af6d15763e4c322c2c7671582ed6c3b006 (diff)
parentb4f2d03db2cd20688d6bb537904998e997bc48aa (diff)
Merge branch 'optional-list-indexing' into dev
Diffstat (limited to 'test')
-rw-r--r--test/enums.tm4
-rw-r--r--test/iterators.tm3
-rw-r--r--test/text.tm3
3 files changed, 6 insertions, 4 deletions
diff --git a/test/enums.tm b/test/enums.tm
index 1d00cd1a..9a0188a2 100644
--- a/test/enums.tm
+++ b/test/enums.tm
@@ -61,7 +61,7 @@ func main()
i := 1
cases := [Foo.One(1), Foo.One(2), Foo.Zero]
- repeat when cases[i] is One(x)
+ repeat when cases[i]! is One(x)
>> x
i += 1
else stop
@@ -78,7 +78,7 @@ func main()
]
= ["Zero", "Small 1", "Small 2", "Other"]
- >> expr := when cases[1] is One(y)
+ >> expr := when cases[1]! is One(y)
y + 1
else
-1
diff --git a/test/iterators.tm b/test/iterators.tm
index 08382cff..c48e572b 100644
--- a/test/iterators.tm
+++ b/test/iterators.tm
@@ -4,9 +4,8 @@ struct Pair(x:Text, y:Text)
func pairwise(strs:[Text] -> func(->Pair?))
i := 1
return func()
- if i + 1 > strs.length return none
i += 1
- return Pair(strs[i-1], strs[i])?
+ return Pair(strs[i-1] or return none, strs[i] or return none)?
func range(first:Int, last:Int -> func(->Int?))
i := first
diff --git a/test/text.tm b/test/text.tm
index 266d8c03..46e1ae41 100644
--- a/test/text.tm
+++ b/test/text.tm
@@ -34,6 +34,9 @@ func main()
>> str[9]
= "é"
+ >> str[99]
+ = none
+
>> "\{UE9}"
= "é"