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/array_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/array_spec.moon')
| -rw-r--r-- | spec/lib/array_spec.moon | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/spec/lib/array_spec.moon b/spec/lib/array_spec.moon index 130138c..dcad2ad 100644 --- a/spec/lib/array_spec.moon +++ b/spec/lib/array_spec.moon @@ -6,15 +6,20 @@ describe "array", -> svec3 = Array 3, T.str - it "can contain any type", -> - COPILOT\eval_once '[1 2 3]' - COPILOT\eval_once '[true false]' - COPILOT\eval_once '["a"]' - COPILOT\eval_once '[[1 2] [3 4]]' - - it "cannot contain mixed types", -> - err = assert.has.error -> COPILOT\eval_once '[1 false]' - assert.matches "argument error: couldn't match arguments", err + describe "literal", -> + it "can't be empty", -> + err = assert.has.error -> COPILOT\eval_once '[]' + assert.matches "syntax error: array literal can't be empty", err + + it "can contain any type", -> + COPILOT\eval_once '[1 2 3]' + COPILOT\eval_once '[true false]' + COPILOT\eval_once '["a"]' + COPILOT\eval_once '[[1 2] [3 4]]' + + it "cannot contain mixed types", -> + err = assert.has.error -> COPILOT\eval_once '[1 false]' + assert.matches "argument error: couldn't match arguments", err describe "(set)", -> it "can swap values", -> |
