summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2024-05-18 07:23:11 -0700
committerRose Hogenson <rosehogenson@posteo.net>2024-06-08 13:59:25 -0700
commit4fe42be07b7b57147f9cac0d17c2611f71f0758a (patch)
treef1bef68c480a04db1dcff04925ce8b2e98f73119 /tests
parent07c1a4a35923079d92867794b8ea621d44543ef1 (diff)
downloadsml-4fe42be07b7b57147f9cac0d17c2611f71f0758a.tar.zst
Add structures.
Diffstat (limited to 'tests')
-rw-r--r--tests/20-structure.sml5
-rw-r--r--tests/21-struct-datatype.sml6
2 files changed, 11 insertions, 0 deletions
diff --git a/tests/20-structure.sml b/tests/20-structure.sml
new file mode 100644
index 0000000..dfc7b9b
--- /dev/null
+++ b/tests/20-structure.sml
@@ -0,0 +1,5 @@
+structure S = struct
+ val fourtyTwo = 42
+end
+
+val _ = __builtin "exit" S.fourtyTwo
diff --git a/tests/21-struct-datatype.sml b/tests/21-struct-datatype.sml
new file mode 100644
index 0000000..ab714ea
--- /dev/null
+++ b/tests/21-struct-datatype.sml
@@ -0,0 +1,6 @@
+structure S = struct
+ datatype D = D of int
+end
+
+val S.D x = S.D 42
+val _ = __builtin "exit" x