diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-02-20 17:53:40 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-02-20 23:34:33 +0100 |
| commit | 05727bfc3a9cfd45a8e2028dfd0806f7a8f88015 (patch) | |
| tree | 6c0b66eb2a9dff224cb39eb6ccb478656a706c04 /tests/typ/expr/array.typ | |
| parent | 927341d93ae29678095e3b874bd68bfc57d4bc05 (diff) | |
Reorganize tests 🔀
Diffstat (limited to 'tests/typ/expr/array.typ')
| -rw-r--r-- | tests/typ/expr/array.typ | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/typ/expr/array.typ b/tests/typ/expr/array.typ new file mode 100644 index 00000000..c9383501 --- /dev/null +++ b/tests/typ/expr/array.typ @@ -0,0 +1,43 @@ +// Test arrays. + +--- +// Empty. +{()} + +// Not an array, just a parenthesized expression. +{(1)} + +// One item and trailing comma. +{(-1,)} + +// No trailing comma. +{(true, false)} + +// Multiple lines and items and trailing comma. +{("1" + , #002 + ,)} + +// Error: 3 expected closing paren +{(} + +// Error: 2-3 expected expression, found closing paren +{)} + +// Error: 2:4 expected comma +// Error: 1:4-1:6 expected expression, found end of block comment +{(1*/2)} + +// Error: 6-8 expected expression, found invalid token +{(1, 1u 2)} + +// Error: 3-4 expected expression, found comma +{(,1)} + +// Missing expression makes named pair incomplete, making this an empty array. +// Error: 5 expected expression +{(a:)} + +// Named pair after this is already identified as an array. +// Error: 6-10 expected expression, found named pair +{(1, b: 2)} |
