summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/ref-to-empty-label-not-possible.pngbin0 -> 182 bytes
-rw-r--r--tests/suite/foundations/label.typ4
-rw-r--r--tests/suite/model/bibliography.typ8
-rw-r--r--tests/suite/model/ref.typ11
4 files changed, 23 insertions, 0 deletions
diff --git a/tests/ref/ref-to-empty-label-not-possible.png b/tests/ref/ref-to-empty-label-not-possible.png
new file mode 100644
index 00000000..774b7958
--- /dev/null
+++ b/tests/ref/ref-to-empty-label-not-possible.png
Binary files differ
diff --git a/tests/suite/foundations/label.typ b/tests/suite/foundations/label.typ
index 3b84c2d7..6eb2a9fd 100644
--- a/tests/suite/foundations/label.typ
+++ b/tests/suite/foundations/label.typ
@@ -92,3 +92,7 @@ _Visible_
--- label-non-existent-error ---
// Error: 5-10 sequence does not have field "label"
#[].label
+
+--- label-empty ---
+// Error: 23-32 label name must not be empty
+= Something to label #label("")
diff --git a/tests/suite/model/bibliography.typ b/tests/suite/model/bibliography.typ
index 23576c15..6a0c3e3c 100644
--- a/tests/suite/model/bibliography.typ
+++ b/tests/suite/model/bibliography.typ
@@ -75,6 +75,14 @@ Now we have multiple bibliographies containing @glacier-melt @keshav2007read
// Error: 2-62 CSL style "Alphanumeric" is not suitable for bibliographies
#bibliography("/assets/bib/works.bib", style: "alphanumeric")
+--- bibliography-empty-key ---
+#let src = ```yaml
+"":
+ type: Book
+```
+// Error: 15-30 bibliography contains entry with empty key
+#bibliography(bytes(src.text))
+
--- issue-4618-bibliography-set-heading-level ---
// Test that the bibliography block's heading is set to 2 by the show rule,
// and therefore should be rendered like a level-2 heading. Notably, this
diff --git a/tests/suite/model/ref.typ b/tests/suite/model/ref.typ
index 87b1c409..d48072ed 100644
--- a/tests/suite/model/ref.typ
+++ b/tests/suite/model/ref.typ
@@ -86,3 +86,14 @@ Text seen on #ref(<text>, form: "page", supplement: "Page").
// Test reference with non-whitespace before it.
#figure[] <1>
#test([(#ref(<1>))], [(@1)])
+
+--- ref-to-empty-label-not-possible ---
+// @ without any following label should just produce the symbol in the output
+// and not produce a reference to a label with an empty name.
+@
+
+--- ref-function-empty-label ---
+// using ref() should also not be possible
+// Error: 6-7 unexpected less-than operator
+// Error: 7-8 unexpected greater-than operator
+#ref(<>)