From 06c239e4f44849a3e4c8317194caacbcc47fc2d4 Mon Sep 17 00:00:00 2001 From: s-ol Date: Sun, 14 Sep 2025 12:12:13 +0200 Subject: de/fn, loop parameter lists use square brackets --- spec/lib/array_spec.moon | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'spec/lib/array_spec.moon') 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", -> -- cgit v1.2.3