summaryrefslogtreecommitdiff
path: root/lib/std/test/try.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-08-26 12:20:58 -0700
committerOri Bernstein <ori@eigenstate.org>2015-08-26 12:20:58 -0700
commit2bc852bda98762d3bc01548bf972e3f1b137fbfb (patch)
tree74831deed3c9057c5fe0cbb8790d220e855bc792 /lib/std/test/try.myr
parent3de952510eb2a23350d24ed926f19c0cf72a12f2 (diff)
downloadmc-2bc852bda98762d3bc01548bf972e3f1b137fbfb.tar.gz
Move Myrddin libs to lib/ subdirectory.
Diffstat (limited to 'lib/std/test/try.myr')
-rw-r--r--lib/std/test/try.myr8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/std/test/try.myr b/lib/std/test/try.myr
new file mode 100644
index 0000000..525b95c
--- /dev/null
+++ b/lib/std/test/try.myr
@@ -0,0 +1,8 @@
+use std
+
+const main = {
+ var x = `std.Some 123
+ var r : std.result(int, byte[:]) = `std.Ok 666
+ std.assert(std.get(x) == 123, "expected 123 from try")
+ std.assert(std.try(r) == 666, "expected 123 from try")
+}