about summary refs log tree commit diff
path: root/boot/tests/parse
diff options
context:
space:
mode:
Diffstat (limited to 'boot/tests/parse')
-rw-r--r--boot/tests/parse/generics.cskt0
-rw-r--r--boot/tests/parse/simple_types.cskt35
2 files changed, 35 insertions, 0 deletions
diff --git a/boot/tests/parse/generics.cskt b/boot/tests/parse/generics.cskt
deleted file mode 100644
index e69de29..0000000
--- a/boot/tests/parse/generics.cskt
+++ /dev/null
diff --git a/boot/tests/parse/simple_types.cskt b/boot/tests/parse/simple_types.cskt
index e69de29..fe7e9ae 100644
--- a/boot/tests/parse/simple_types.cskt
+++ b/boot/tests/parse/simple_types.cskt
@@ -0,0 +1,35 @@
+basic, non-generic type declarations
+
+<<<
+
+Person = type {
+    name string
+    age uint
+    address string?
+}
+
+Maybe = variant {
+    Nothing
+    Just any
+}
+
+Error = class {
+    error() string
+}
+
+Result = variant {
+    Ok any
+    Error Error
+}
+
+Twins = type (Person, Person)
+Group = type [Person]
+
+>>>
+
+(expr (binary = (expr (name Person)) (expr (type structure (field name) (type name string) (field age) (type name uint) (field address) (type maybe (type name string))))))
+(expr (binary = (expr (name Maybe)) (expr (type variant (variant Nothing) (variant Just of (type name any))))))
+(expr (binary = (expr (name Error)) (expr (type class (method error (returns (type name string)))))))
+(expr (binary = (expr (name Result)) (expr (type variant (variant Ok of (type name any)) (variant Error of (type name Error))))))
+(expr (binary = (expr (name Twins)) (expr (type tuple (type name Person) (type name Person)))))
+(expr (binary = (expr (name Group)) (expr (type array of (type name Person)))))
\ No newline at end of file