summaryrefslogtreecommitdiff
path: root/tests/suite/introspection
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-09-16 16:41:18 +0200
committerGitHub <noreply@github.com>2024-09-16 14:41:18 +0000
commit16e67f8bea7e6891e954420e2e005976fb48a528 (patch)
treeb1de8e17f184d10894447a602da1722a71dd23a9 /tests/suite/introspection
parentdb71a178bef7f1525d732a190ac75a1a6d56f24b (diff)
Shrink tests (#4967)
Diffstat (limited to 'tests/suite/introspection')
-rw-r--r--tests/suite/introspection/counter.typ6
-rw-r--r--tests/suite/introspection/query.typ76
-rw-r--r--tests/suite/introspection/state.typ2
3 files changed, 10 insertions, 74 deletions
diff --git a/tests/suite/introspection/counter.typ b/tests/suite/introspection/counter.typ
index 8cae32a4..e97f05dd 100644
--- a/tests/suite/introspection/counter.typ
+++ b/tests/suite/introspection/counter.typ
@@ -54,13 +54,13 @@ At Beta, it was #context {
--- counter-page ---
#set page(height: 50pt, margin: (bottom: 20pt, rest: 10pt))
-#lorem(12)
+#lines(4)
#set page(numbering: "(i)")
-#lorem(6)
+#lines(2)
#pagebreak()
#set page(numbering: "1 / 1")
#counter(page).update(1)
-#lorem(20)
+#lines(7)
--- counter-page-footer-before-set-page ---
#set page(numbering: "1", margin: (bottom: 20pt))
diff --git a/tests/suite/introspection/query.typ b/tests/suite/introspection/query.typ
index 3d71529e..b078863e 100644
--- a/tests/suite/introspection/query.typ
+++ b/tests/suite/introspection/query.typ
@@ -72,80 +72,11 @@
caption: [Tetrahedron],
)
---- query-before-after ---
-// LARGE
-#set page(
- paper: "a7",
- numbering: "1 / 1",
- margin: (bottom: 1cm, rest: 0.5cm),
-)
-
-#show heading.where(level: 1, outlined: true): it => [
- #it
-
- #set text(size: 12pt, weight: "regular")
- #outline(
- title: none,
- indent: true,
- target: heading
- .where(level: 1)
- .or(heading.where(level: 2))
- .after(it.location(), inclusive: true)
- .before(
- heading
- .where(level: 1, outlined: true)
- .after(it.location(), inclusive: false),
- inclusive: false,
- )
- )
-]
-
-#set heading(outlined: true, numbering: "1.")
-
-= Section 1
-== Subsection 1
-== Subsection 2
-=== Subsubsection 1
-=== Subsubsection 2
-== Subsection 3
-
-= Section 2
-== Subsection 1
-== Subsection 2
-
-= Section 3
-== Subsection 1
-== Subsection 2
-=== Subsubsection 1
-=== Subsubsection 2
-=== Subsubsection 3
-== Subsection 3
-
---- query-and-or ---
-#set page(
- paper: "a7",
- numbering: "1 / 1",
- margin: (bottom: 1cm, rest: 0.5cm),
-)
-
-#set heading(outlined: true, numbering: "1.")
-
-#context [
- Non-outlined elements:
- #(query(selector(heading).and(heading.where(outlined: false)))
- .map(it => it.body).join(", "))
-]
-
-#heading("A", outlined: false)
-#heading("B", outlined: true)
-#heading("C", outlined: true)
-#heading("D", outlined: false)
-
--- query-complex ---
= A
== B
#figure([Cat], kind: "cat", supplement: [Other])
-=== D
+#heading(level: 3, outlined: false)[D]
= E <first>
#figure([Frog], kind: "frog", supplement: none)
#figure([Giraffe], kind: "giraffe", supplement: none) <second>
@@ -165,6 +96,11 @@
)
#test-selector(
+ selector(heading).and(heading.where(outlined: false)),
+ ([D],)
+)
+
+#test-selector(
heading.where(level: 1).or(
heading.where(level: 3),
figure.where(kind: "frog"),
diff --git a/tests/suite/introspection/state.typ b/tests/suite/introspection/state.typ
index 208a4ea2..bb5f1a41 100644
--- a/tests/suite/introspection/state.typ
+++ b/tests/suite/introspection/state.typ
@@ -28,7 +28,7 @@ Was: #context {
#set page(width: 200pt)
#set text(8pt)
-#let ls = state("lorem", lorem(1000).split("."))
+#let ls = state("lorem", lorem(30).split(" "))
#let loremum(count) = {
context ls.get().slice(0, count).join(".").trim() + "."
ls.update(list => list.slice(count))