diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-11 23:17:03 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-11 23:17:03 -0400 |
| commit | c034175ae1cbe53bc0e7e1ae71b51c64dcc3402a (patch) | |
| tree | 8a6b1754c7530399a563d7b80a669d6d08d8af37 /test | |
| parent | cfef667a899339a0fd5b79214d581db6ede10748 (diff) | |
Add optional:or_else(fallback) and optional:or_fail(message)
Diffstat (limited to 'test')
| -rw-r--r-- | test/optionals.tm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/optionals.tm b/test/optionals.tm index e2cdf9a6..26e825ae 100644 --- a/test/optionals.tm +++ b/test/optionals.tm @@ -83,6 +83,15 @@ func main(): 5 = 5? : Int? + >> (5?):or_else(-1) + = 5 : Int + + >> (5?):or_fail() + = 5 : Int + + >> (!Int):or_else(-1) + = -1 : Int + do: !! Ints: >> yep := maybe_int(yes) |
