summaryrefslogtreecommitdiff
path: root/tests/typ/compiler
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-02-05 10:42:14 +0100
committerGitHub <noreply@github.com>2024-02-05 09:42:14 +0000
commit92aba81a91364eb49f3a613cd2db3b2163202434 (patch)
tree28e471e3d882b480b190c3024f21548de73683d7 /tests/typ/compiler
parentb224769c85767bccc8f21ab5ecaa01d93a5ea149 (diff)
Support text show rules that match their own output (#3327)
Diffstat (limited to 'tests/typ/compiler')
-rw-r--r--tests/typ/compiler/recursion.typ15
-rw-r--r--tests/typ/compiler/show-text.typ21
2 files changed, 21 insertions, 15 deletions
diff --git a/tests/typ/compiler/recursion.typ b/tests/typ/compiler/recursion.typ
index ef5ea7e6..f5f870b5 100644
--- a/tests/typ/compiler/recursion.typ
+++ b/tests/typ/compiler/recursion.typ
@@ -52,20 +52,5 @@
// Test recursive show rules.
// Error: 22-25 maximum show rule depth exceeded
// Hint: 22-25 check whether the show rule matches its own output
-// Hint: 22-25 this is a current compiler limitation that will be resolved in the future
#show math.equation: $x$
$ x $
-
----
-// Error: 18-21 maximum show rule depth exceeded
-// Hint: 18-21 check whether the show rule matches its own output
-// Hint: 18-21 this is a current compiler limitation that will be resolved in the future
-#show "hey": box[hey]
-hey
-
----
-// Error: 14-19 maximum show rule depth exceeded
-// Hint: 14-19 check whether the show rule matches its own output
-// Hint: 14-19 this is a current compiler limitation that will be resolved in the future
-#show "hey": "hey"
-hey
diff --git a/tests/typ/compiler/show-text.typ b/tests/typ/compiler/show-text.typ
index c279507b..7837bb46 100644
--- a/tests/typ/compiler/show-text.typ
+++ b/tests/typ/compiler/show-text.typ
@@ -14,6 +14,27 @@ Die Zeitung Der Spiegel existiert.
TeX, LaTeX, LuaTeX and LuaLaTeX!
---
+// Test direct cycle.
+#show "Hello": text(red)[Hello]
+Hello World!
+
+---
+// Test replacing text with raw text.
+#show "rax": `rax`
+The register rax.
+
+---
+// Test indirect cycle.
+#show "Good": [Typst!]
+#show "Typst": [Fun!]
+#show "Fun": [Good!]
+
+#set text(ligatures: false)
+Good \
+Fun \
+Typst \
+
+---
// Test that replacements happen exactly once.
#show "A": [BB]
#show "B": [CC]