summaryrefslogtreecommitdiff
path: root/tests/typ/code
diff options
context:
space:
mode:
Diffstat (limited to 'tests/typ/code')
-rw-r--r--tests/typ/code/field.typ24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/typ/code/field.typ b/tests/typ/code/field.typ
new file mode 100644
index 00000000..b30d72e0
--- /dev/null
+++ b/tests/typ/code/field.typ
@@ -0,0 +1,24 @@
+// Test field access.
+// Ref: false
+
+---
+#let dict = (nothing: "ness", hello: "world")
+#test(dict.nothing, "ness")
+{
+ let world = dict
+ .hello
+
+ test(world, "world")
+}
+
+---
+// Error: 2-13 dictionary does not contain key: "invalid"
+{(:).invalid}
+
+---
+// Error: 2-7 cannot access field on boolean
+{false.ok}
+
+---
+// Error: 8-12 expected identifier, found boolean
+{false.true}