From 2a45650dcc87c3bf047adaf030fd392bbe9fbb5e Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 4 May 2022 23:04:19 +0200 Subject: Keyed pairs --- tests/typ/code/field.typ | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/typ/code/field.typ') diff --git a/tests/typ/code/field.typ b/tests/typ/code/field.typ index abccaede..b63a8768 100644 --- a/tests/typ/code/field.typ +++ b/tests/typ/code/field.typ @@ -2,6 +2,7 @@ // Ref: false --- +// Test field on dictionary. #let dict = (nothing: "ness", hello: "world") #test(dict.nothing, "ness") { @@ -11,6 +12,16 @@ test(world, "world") } +--- +// Test field on node. +#show node: list as { + test(node.items.len(), 3) +} + +- A +- B +- C + --- // Error: 6-13 dictionary does not contain key "invalid" {(:).invalid} @@ -19,6 +30,11 @@ // Error: 2-7 cannot access field on boolean {false.ok} +--- +// Error: 29-32 unknown field "fun" +#show node: heading as node.fun += A + --- // Error: 8-12 expected identifier, found boolean {false.true} -- cgit v1.2.3