diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/suite/scripting/arguments.typ | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/suite/scripting/arguments.typ b/tests/suite/scripting/arguments.typ new file mode 100644 index 00000000..e82f4962 --- /dev/null +++ b/tests/suite/scripting/arguments.typ @@ -0,0 +1,18 @@ +// Test arguments. + +--- arguments-at --- +#let args = arguments(0, 1, a: 2, 3) +#test(args.at(0), 0) +#test(args.at(1), 1) +#test(args.at(2), 3) +#test(args.at("a"), 2) + +--- arguments-at-invalid-index --- +#let args = arguments(0, 1, a: 2, 3) +// Error: 2-12 arguments do not contain key 4 and no default value was specified +#args.at(4) + +--- arguments-at-invalid-name --- +#let args = arguments(0, 1, a: 2, 3) +// Error: 2-14 arguments do not contain key "b" and no default value was specified +#args.at("b") |
