summaryrefslogtreecommitdiff
path: root/tests/suite/model
diff options
context:
space:
mode:
Diffstat (limited to 'tests/suite/model')
-rw-r--r--tests/suite/model/bibliography.typ5
-rw-r--r--tests/suite/model/cite.typ10
-rw-r--r--tests/suite/model/footnote.typ31
-rw-r--r--tests/suite/model/numbering.typ166
-rw-r--r--tests/suite/model/outline.typ60
-rw-r--r--tests/suite/model/quote.typ6
-rw-r--r--tests/suite/model/terms.typ14
7 files changed, 110 insertions, 182 deletions
diff --git a/tests/suite/model/bibliography.typ b/tests/suite/model/bibliography.typ
index 18c62620..20eb8acd 100644
--- a/tests/suite/model/bibliography.typ
+++ b/tests/suite/model/bibliography.typ
@@ -44,9 +44,8 @@ Now we have multiple bibliographies containing @glacier-melt @keshav2007read
#bibliography("/assets/bib/works.bib")
--- bibliography-full ---
-// LARGE
-#set page(paper: "a6", height: 170mm)
-#bibliography("/assets/bib/works.bib", full: true)
+#set page(paper: "a6", height: auto)
+#bibliography("/assets/bib/works_too.bib", full: true)
--- bibliography-math ---
#set page(width: 200pt)
diff --git a/tests/suite/model/cite.typ b/tests/suite/model/cite.typ
index 750db38b..ffbd3b52 100644
--- a/tests/suite/model/cite.typ
+++ b/tests/suite/model/cite.typ
@@ -52,10 +52,10 @@ A @netwok @arrgh @quark, B.
--- issue-785-cite-locate ---
// Test citation in other introspection.
#set page(width: 180pt)
-#set heading(numbering: "1")
+#set heading(numbering: "1.")
#outline(
- title: [List of Figures],
+ title: [Figures],
target: figure.where(kind: image),
)
@@ -63,20 +63,20 @@ A @netwok @arrgh @quark, B.
= Introduction <intro>
#figure(
- rect[-- PIRATE --],
+ rect(height: 10pt),
caption: [A pirate @arrgh in @intro],
)
#context [Citation @distress on page #here().page()]
-#pagebreak()
+#show bibliography: none
#bibliography("/assets/bib/works.bib", style: "chicago-notes")
--- issue-1597-cite-footnote ---
// Tests that when a citation footnote is pushed to next page, things still
// work as expected.
#set page(height: 60pt)
-#lorem(4)
+A
#footnote[@netwok]
#show bibliography: none
diff --git a/tests/suite/model/footnote.typ b/tests/suite/model/footnote.typ
index 99372551..41091228 100644
--- a/tests/suite/model/footnote.typ
+++ b/tests/suite/model/footnote.typ
@@ -34,28 +34,31 @@ Fourth
Beautiful footnotes. #footnote[Wonderful, aren't they?]
--- footnote-break-across-pages ---
-// LARGE
#set page(height: 200pt)
-#lorem(5)
+#lines(2)
#footnote[ // 1
- A simple footnote.
- #footnote[Well, not that simple ...] // 2
+ I
+ #footnote[II ...] // 2
]
-#lorem(15)
-#footnote[Another footnote: #lorem(30)] // 3
-#lorem(15)
-#footnote[My fourth footnote: #lorem(50)] // 4
-#lorem(15)
-#footnote[And a final footnote.] // 5
+#lines(6)
+#footnote[III: #lines(8, "1")] // 3
+#lines(6)
+#footnote[IV: #lines(15, "1")] // 4
+#lines(6)
+#footnote[V] // 5
--- footnote-in-columns ---
// Test footnotes in columns, even those that are not enabled via `set page`.
#set page(height: 120pt)
#align(center, strong[Title])
+
#show: columns.with(2)
-#lorem(3) #footnote(lorem(6))
-Hello there #footnote(lorem(2))
+#lines(3)
+#footnote(lines(4, "1"))
+
+#lines(2)
+#footnote(lines(2, "1"))
--- footnote-in-caption ---
// Test footnote in caption.
@@ -93,9 +96,9 @@ More #footnote[just for ...] footnotes #footnote[... testing. :)]
// always end up on the same page.
#set page(height: 120pt)
-#lorem(13)
+#lines(5)
-There #footnote(lorem(20))
+A #footnote(lines(6, "1"))
--- footnote-ref ---
// Test references to footnotes.
diff --git a/tests/suite/model/numbering.typ b/tests/suite/model/numbering.typ
index 55c24f65..93c9e1b3 100644
--- a/tests/suite/model/numbering.typ
+++ b/tests/suite/model/numbering.typ
@@ -1,120 +1,58 @@
// Test integrated numbering patterns.
---- numbering-symbol-and-roman ---
-#for i in range(0, 9) {
- numbering("*", i)
- [ and ]
- numbering("I.a", i, i)
- [ for #i \ ]
-}
-
---- numbering-latin ---
-#for i in range(0, 4) {
- numbering("A", i)
- [ for #i \ ]
-}
-... \
-#for i in range(26, 30) {
- numbering("A", i)
- [ for #i \ ]
-}
-... \
-#for i in range(702, 706) {
- numbering("A", i)
- [ for #i \ ]
-}
-
---- numbering-hebrew ---
-#set text(lang: "he")
-#for i in range(9, 21, step: 2) {
- numbering("א.", i)
- [ עבור #i \ ]
-}
-
---- numbering-chinese ---
-#set text(lang: "zh", font: ("Linux Libertine", "Noto Serif CJK SC"))
-#for i in range(9, 21, step: 2){
- numbering("一", i)
- [ and ]
- numbering("壹", i)
- [ for #i \ ]
-}
-
---- numbering-japanese-iroha ---
-#set text(lang: "ja", font: ("Linux Libertine", "Noto Serif CJK JP"))
-#for i in range(0, 4) {
- numbering("イ", i)
- [ (or ]
- numbering("い", i)
- [) for #i \ ]
-}
-... \
-#for i in range(47, 51) {
- numbering("イ", i)
- [ (or ]
- numbering("い", i)
- [) for #i \ ]
-}
-... \
-#for i in range(2256, 2260) {
- numbering("イ", i)
- [ for #i \ ]
-}
-
---- numbering-korean ---
-#set text(lang: "ko", font: ("Linux Libertine", "Noto Serif CJK KR"))
-#for i in range(0, 4) {
- numbering("가", i)
- [ (or ]
- numbering("ㄱ", i)
- [) for #i \ ]
-}
-... \
-#for i in range(47, 51) {
- numbering("가", i)
- [ (or ]
- numbering("ㄱ", i)
- [) for #i \ ]
-}
-... \
-#for i in range(2256, 2260) {
- numbering("ㄱ", i)
- [ for #i \ ]
-}
-
---- numbering-japanese-aiueo ---
-#set text(lang: "jp", font: ("Linux Libertine", "Noto Serif CJK JP"))
-#for i in range(0, 9) {
- numbering("あ", i)
- [ and ]
- numbering("I.あ", i, i)
- [ for #i \ ]
-}
-
-#for i in range(0, 9) {
- numbering("ア", i)
- [ and ]
- numbering("I.ア", i, i)
- [ for #i \ ]
-}
-
---- numbering-arabic-indic ---
-#assert.eq(numbering("\u{0661}", 1475), "١٤٧٥")
-#assert.eq(numbering("\u{06F1}", 1475), "۱۴۷۵")
-
---- numbering-devanagari-number ---
-#assert.eq(numbering("\u{0967}", 1), "१")
-#assert.eq(numbering("\u{0967}", 10), "१०")
-#assert.eq(numbering("\u{0967}", 123456789), "१२३४५६७८९")
+--- numbering ---
+#let t(pat: "1", step: 1, ..vals) = {
+ let num = 0
+ for val in vals.pos() {
+ if type(val) == int {
+ num = val
+ } else {
+ test(numbering(pat, num), val)
+ num += step
+ }
+ }
+}
+
+// Arabic.
+#t(pat: "1", "0", "1", "2", "3", "4", "5", "6", 107, "107", "108")
+
+// Symbols.
+#t(pat: "*", "-", "*", "†", "‡", "§", "¶", "‖", "**")
+
+// Hebrew.
+#t(pat: "א", step: 2, 9, "ט׳", "י״א", "י״ג")
+
+// Chinese.
+#t(pat: "一", step: 2, 9, "九", "十一", "十三", "十五", "十七", "十九")
+#t(pat: "壹", step: 2, 9, "玖", "拾壹", "拾叁", "拾伍", "拾柒", "拾玖")
+
+// Japanese.
+#t(pat: "イ", "-", "イ", "ロ", "ハ", 47, "ス", "イイ", "イロ", "イハ", 2256, "スス", "イイイ")
+#t(pat: "い", "-", "い", "ろ", "は", 47, "す", "いい", "いろ", "いは")
+#t(pat: "あ", "-", "あ", "い", "う", "え", "お", "か", "き", "く")
+#t(pat: "ア", "-", "ア", "イ", "ウ", "エ", "オ", "カ", "キ", "ク")
+
+// Korean.
+#t(pat: "가", "-", "가", "나", "다", 47, "다마", "다바", "다사", "다아")
+#t(pat: "ㄱ", "-", "ㄱ", "ㄴ", "ㄷ", 47, "ㄷㅁ")
+
+// Arabic Indic.
+#t(pat: "\u{0661}", 1475, "١٤٧٥")
+#t(pat: "\u{06F1}", 1475, "۱۴۷۵")
+
+// Devanagari.
+#t(pat: "\u{0967}", 1, "१")
+#t(pat: "\u{0967}", 10, "१०")
+#t(pat: "\u{0967}", 123456789, "१२३४५६७८९")
+
+// Circled number.
+#t(pat: "①", 1, "①")
+#t(pat: "①", 50, "㊿")
+
+// Double-circled number.
+#t(pat: "⓵", 1, "⓵")
+#t(pat: "⓵", 10, "⓾")
--- numbering-negative ---
// Error: 17-19 number must be at least zero
#numbering("1", -1)
-
---- numbering-circled-number ---
-#assert.eq(numbering("①", 1), "①")
-#assert.eq(numbering("①", 50), "㊿")
-
---- numbering-double-circled-number ---
-#assert.eq(numbering("⓵", 1), "⓵")
-#assert.eq(numbering("⓵", 10), "⓾")
diff --git a/tests/suite/model/outline.typ b/tests/suite/model/outline.typ
index 2409dbbe..3c134760 100644
--- a/tests/suite/model/outline.typ
+++ b/tests/suite/model/outline.typ
@@ -1,53 +1,41 @@
--- outline ---
-// LARGE
-#set page("a7", margin: 20pt, numbering: "1")
+#set page(height: 200pt, margin: (bottom: 20pt), numbering: "1")
#set heading(numbering: "(1/a)")
#show heading.where(level: 1): set text(12pt)
#show heading.where(level: 2): set text(10pt)
-#set math.equation(numbering: "1")
-#outline()
-#outline(title: [Figures], target: figure)
-#outline(title: [Equations], target: math.equation)
-
-= Introduction
-#lorem(12)
+#outline(fill: none)
-= Analysis
-#lorem(10)
+= A
+= B
+#lines(3)
+// This heading is right at the start of the page, so that we can test
+// whether the tag migrates properly.
#[
#set heading(outlined: false)
- == Methodology
- #lorem(6)
+ == C
]
-== Math
-$x$ is a very useful constant. See it in action:
-$ x = x $
+A
-== Interesting figures
-#figure(rect[CENSORED], kind: image, caption: [A picture showing a programmer at work.])
-#figure(table[1x1], caption: [A very small table.])
+== D
+== F
+==== G
-== Programming
-```rust
-fn main() {
- panic!("in the disco");
-}
-```
+--- outline-styled-text ---
+#outline(title: none)
+
+= #text(blue)[He]llo
-==== Deep Stuff
-Ok ...
+--- outline-bookmark ---
+#outline(title: none, fill: none)
// Ensure 'bookmarked' option doesn't affect the outline
#set heading(numbering: "(I)", bookmarked: false)
-
-= #text(blue)[Sum]mary
-#lorem(10)
+= A
--- outline-indent-numbering ---
-// LARGE
// With heading numbering
#set page(width: 200pt)
#set heading(numbering: "1.a.")
@@ -62,11 +50,11 @@ Ok ...
#outline(indent: 2em)
#outline(indent: n => ([-], [], [==], [====]).at(n))
-= About ACME Corp.
-== History
-== Products
-=== Categories
-==== General
+= A
+== B
+== C
+=== D
+==== E
--- outline-indent-no-numbering ---
// Without heading numbering
diff --git a/tests/suite/model/quote.typ b/tests/suite/model/quote.typ
index d71eeeab..2c93f92c 100644
--- a/tests/suite/model/quote.typ
+++ b/tests/suite/model/quote.typ
@@ -20,9 +20,9 @@ And I quote: #quote(attribution: [René Descartes])[cogito, ergo sum].
#set quote(block: true)
#set text(8pt)
-#lorem(10)
-#quote(lorem(10))
-#lorem(10)
+#lines(3)
+#quote(lines(3))
+#lines(3)
--- quote-inline ---
// Inline citation
diff --git a/tests/suite/model/terms.typ b/tests/suite/model/terms.typ
index 6a08b923..07aa827d 100644
--- a/tests/suite/model/terms.typ
+++ b/tests/suite/model/terms.typ
@@ -60,17 +60,17 @@ Not in list
/ Hello
--- issue-1050-terms-indent ---
-#set page(width: 200pt)
+#set page(width: 110pt)
#set par(first-line-indent: 0.5cm)
-- #lorem(10)
-- #lorem(10)
+- #lorem(5)
+- #lorem(5)
-+ #lorem(10)
-+ #lorem(10)
++ #lorem(5)
++ #lorem(5)
-/ Term 1: #lorem(10)
-/ Term 2: #lorem(10)
+/ S: #lorem(5)
+/ XXXL: #lorem(5)
--- issue-2530-term-item-panic ---
// Term item (pre-emptive)