aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-16 16:06:19 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-16 16:06:19 -0400
commitde49bc5bb3198f450cb367085f9def0d89782258 (patch)
treea81354271bd3de567a7656807416cd5c69e4b08b /test
parent821bde156c222c7384c67517d773dc14a03342e7 (diff)
Deprecate :or_else()/:or_fail()/:or_exit() in favor of the `or` operator
Diffstat (limited to 'test')
-rw-r--r--test/optionals.tm8
-rw-r--r--test/tables.tm6
2 files changed, 7 insertions, 7 deletions
diff --git a/test/optionals.tm b/test/optionals.tm
index 05008e20..2c87d6c9 100644
--- a/test/optionals.tm
+++ b/test/optionals.tm
@@ -83,16 +83,16 @@ func main():
5
= 5? : Int?
- >> (5?):or_else(-1)
+ >> 5? or -1
= 5 : Int
- >> (5?):or_fail()
+ >> 5? or fail("Non-null is falsey")
= 5 : Int
- >> (5?):or_exit()
+ >> 5? or exit("Non-null is falsey")
= 5 : Int
- >> (!Int):or_else(-1)
+ >> (!Int) or -1
= -1 : Int
do:
diff --git a/test/tables.tm b/test/tables.tm
index 50eb5ef5..3dd27b0f 100644
--- a/test/tables.tm
+++ b/test/tables.tm
@@ -10,7 +10,7 @@ func main():
= !Int
>> t:get("one")!
= 1
- >> t:get("???"):or_else(-1)
+ >> t:get("???") or -1
= -1
t_str := ""
@@ -68,7 +68,7 @@ func main():
= 20
>> plain:get(2)!
= 20
- >> plain:get(456):or_else(-999)
+ >> plain:get(456) or -999
= -999
>> plain:has(2)
= yes
@@ -78,6 +78,6 @@ func main():
>> fallback := {4:40; fallback=plain}
>> fallback:has(1)
= yes
- >> fallback:get(1):or_else(-999)
+ >> fallback:get(1) or -999
= 10