erg/tests/should_ok/match.er
2023-10-12 11:30:33 +09:00

9 lines
191 B
Python

f x: Obj =
match x:
(s: Str) -> s + "a"
{ foo; bar } -> foo + bar
a -> a
assert f("a") == "aa"
assert f({ foo = "a"; bar = "b" }) == "ab"
assert str(f(1)) == "1"