summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-02-02 15:25:19 +0100
committerGitHub <noreply@github.com>2024-02-02 14:25:19 +0000
commit2594b367010028277240273e99ab32ac352461f3 (patch)
treec589b155f0f425fb38c1114a007d669c7b3bc9ac /tests
parent356032bf8cdb759e93c2c6b853fe77b9c5f57c07 (diff)
Support for and/or selectors in show rules (#3326)
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/compiler/show-selector-logical.pngbin0 -> 8207 bytes
-rw-r--r--tests/typ/compiler/show-selector-logical.typ21
-rw-r--r--tests/typ/compiler/show-selector.typ4
3 files changed, 21 insertions, 4 deletions
diff --git a/tests/ref/compiler/show-selector-logical.png b/tests/ref/compiler/show-selector-logical.png
new file mode 100644
index 00000000..4d1be5ed
--- /dev/null
+++ b/tests/ref/compiler/show-selector-logical.png
Binary files differ
diff --git a/tests/typ/compiler/show-selector-logical.typ b/tests/typ/compiler/show-selector-logical.typ
new file mode 100644
index 00000000..a11e20b6
--- /dev/null
+++ b/tests/typ/compiler/show-selector-logical.typ
@@ -0,0 +1,21 @@
+// Test and/or selectors in show rules.
+
+---
+// Looking forward to `heading.where(level: 1 | 2)` :)
+#show heading.where(level: 1).or(heading.where(level: 2)): set text(red)
+= L1
+== L2
+=== L3
+==== L4
+
+---
+// Test element selector combined with label selector.
+#show selector(strong).or(<special>): highlight
+I am *strong*, I am _emphasized_, and I am #[special<special>].
+
+---
+// Ensure that text selector cannot be nested in and/or. That's too complicated,
+// at least for now.
+
+// Error: 7-41 this selector cannot be used with show
+#show heading.where(level: 1).or("more"): set text(red)
diff --git a/tests/typ/compiler/show-selector.typ b/tests/typ/compiler/show-selector.typ
index 48a26014..db6db40f 100644
--- a/tests/typ/compiler/show-selector.typ
+++ b/tests/typ/compiler/show-selector.typ
@@ -37,7 +37,3 @@ the ```rs &mut T``` reference.
= Red
== Blue
=== Green
-
----
-// Error: 7-35 this selector cannot be used with show
-#show selector(heading).or(figure): none