summaryrefslogtreecommitdiff
path: root/tests/typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-03-11 17:42:40 +0100
committerLaurenz <laurmaedje@gmail.com>2023-03-11 18:29:48 +0100
commit529d3e10c6b4d973e88b6c295eb22a45ea426e42 (patch)
tree1815aa9336e71565e24d94bacccb98f09e91b693 /tests/typ
parent8e5f446544fd147277ed2e4208c7ea793cc846a7 (diff)
Section references
Diffstat (limited to 'tests/typ')
-rw-r--r--tests/typ/compiler/set.typ4
-rw-r--r--tests/typ/meta/ref.typ21
2 files changed, 23 insertions, 2 deletions
diff --git a/tests/typ/compiler/set.typ b/tests/typ/compiler/set.typ
index 36a42745..a4482e6d 100644
--- a/tests/typ/compiler/set.typ
+++ b/tests/typ/compiler/set.typ
@@ -51,8 +51,8 @@ Hello *#x*
---
// Test conditional set.
#show ref: it => {
- set text(red) if it.target == "unknown"
- it
+ set text(red) if it.label == <unknown>
+ "@" + str(it.label)
}
@hello from the @unknown
diff --git a/tests/typ/meta/ref.typ b/tests/typ/meta/ref.typ
new file mode 100644
index 00000000..85750712
--- /dev/null
+++ b/tests/typ/meta/ref.typ
@@ -0,0 +1,21 @@
+// Test references.
+
+---
+#set heading(numbering: "1.")
+
+= Introduction <intro>
+See @setup.
+
+== Setup <setup>
+As seen in @intro, we proceed.
+
+---
+// Error: 1-5 label does not exist in the document
+@foo
+
+---
+= First <foo>
+= Second <foo>
+
+// Error: 1-5 label occurs multiple times in the document
+@foo