diff options
| author | s-ol <s+removethis@s-ol.nu> | 2025-09-14 10:12:13 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2025-09-14 15:36:21 +0000 |
| commit | 06c239e4f44849a3e4c8317194caacbcc47fc2d4 (patch) | |
| tree | 491c8c5f9e3ad4351aa55951a0d7c70cd8686087 /spec/lib/struct_spec.moon | |
| parent | expose Tag to Ops (diff) | |
| download | alive-06c239e4f44849a3e4c8317194caacbcc47fc2d4.tar.gz alive-06c239e4f44849a3e4c8317194caacbcc47fc2d4.zip | |
de/fn, loop parameter lists use square brackets
Diffstat (limited to 'spec/lib/struct_spec.moon')
| -rw-r--r-- | spec/lib/struct_spec.moon | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/lib/struct_spec.moon b/spec/lib/struct_spec.moon index 94dcc5a..6f740ec 100644 --- a/spec/lib/struct_spec.moon +++ b/spec/lib/struct_spec.moon @@ -6,6 +6,15 @@ describe "struct", -> ab = Struct { a: T.num, b: T.bool } + describe "literal", -> + it "can't be empty", -> + err = assert.has.error -> COPILOT\eval_once '{}' + assert.matches "syntax error: struct literal can't be empty", err + + it "can't have uneven args", -> + err = assert.has.error -> COPILOT\eval_once '{3}' + assert.matches "syntax error: struct literal must have even number of values", err + describe "(set)", -> it "can update values", -> rt = COPILOT\eval_once '(set {"a" 1 "b" false} "a" 2)' |
