aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-08-18 20:58:36 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-08-18 20:58:36 -0400
commit6f3b2c073a968e57d787849dce42ff1253ed0102 (patch)
treee5fb20ae4322fdbbded412c2cb771b7e4ed68ecf /test
parent967b649da20f1cb2011025456853cb55f25e9a88 (diff)
Add `enum.tag` as a way to do a boolean test for whether a value has a
particular tag or not
Diffstat (limited to 'test')
-rw-r--r--test/enums.tm6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/enums.tm b/test/enums.tm
index b734d487..f4af342d 100644
--- a/test/enums.tm
+++ b/test/enums.tm
@@ -23,6 +23,12 @@ func main():
>> Foo.Two(123, 456)
= Foo.Two(x=123, y=456)
+ >> one := Foo.One(123)
+ >> one.One
+ = yes
+ >> one.Two
+ = no
+
>> Foo.One(10) == Foo.One(10)
= yes