diff options
| author | Mel <mel@rnrd.eu> | 2025-07-18 01:36:50 +0200 |
|---|---|---|
| committer | Mel <mel@rnrd.eu> | 2025-07-18 01:36:50 +0200 |
| commit | 9a89772396f13ef27f29e71901a75e4760930cf2 (patch) | |
| tree | e5f4b2a3cf20bf6c05086b7579bc2ba7c6ff1fbe /boot | |
| parent | d7f66d5a286a1da1240d5f255b7ae171c8b6a93f (diff) | |
| download | catskill-9a89772396f13ef27f29e71901a75e4760930cf2.tar.zst catskill-9a89772396f13ef27f29e71901a75e4760930cf2.zip | |
Add catboot test for simple types
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'boot')
| -rw-r--r-- | boot/tests/parse/generics.cskt | 0 | ||||
| -rw-r--r-- | boot/tests/parse/simple_types.cskt | 35 |
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 |
