From 020294fca9a7065d4b9cf4e677f606ebaaa29b00 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sat, 13 Apr 2024 10:39:45 +0200 Subject: Better test runner (#3922) --- tests/typ/meta/bibliography-full.typ | 5 - tests/typ/meta/bibliography-ordering.typ | 16 --- tests/typ/meta/bibliography.typ | 44 ------- tests/typ/meta/cite-footnote.typ | 5 - tests/typ/meta/cite-form.typ | 10 -- tests/typ/meta/cite-group.typ | 19 --- tests/typ/meta/context-compatibility.typ | 29 ----- tests/typ/meta/context.typ | 181 ---------------------------- tests/typ/meta/counter-page.typ | 10 -- tests/typ/meta/counter.typ | 52 -------- tests/typ/meta/document.typ | 49 -------- tests/typ/meta/figure-caption.typ | 64 ---------- tests/typ/meta/figure-localization.typ | 34 ------ tests/typ/meta/figure.typ | 111 ----------------- tests/typ/meta/footnote-break.typ | 16 --- tests/typ/meta/footnote-columns.typ | 9 -- tests/typ/meta/footnote-container.typ | 32 ----- tests/typ/meta/footnote-invariant.typ | 9 -- tests/typ/meta/footnote-refs.typ | 40 ------ tests/typ/meta/footnote-table.typ | 23 ---- tests/typ/meta/footnote.typ | 34 ------ tests/typ/meta/heading.typ | 73 ----------- tests/typ/meta/link.typ | 77 ------------ tests/typ/meta/numbering.typ | 103 ---------------- tests/typ/meta/outline-entry.typ | 59 --------- tests/typ/meta/outline-first-par-indent.typ | 15 --- tests/typ/meta/outline-indent.typ | 60 --------- tests/typ/meta/outline.typ | 45 ------- tests/typ/meta/page-label.typ | 47 -------- tests/typ/meta/query-before-after.typ | 69 ----------- tests/typ/meta/query-figure.typ | 41 ------- tests/typ/meta/query-header.typ | 30 ----- tests/typ/meta/ref.typ | 48 -------- tests/typ/meta/state.typ | 56 --------- 34 files changed, 1515 deletions(-) delete mode 100644 tests/typ/meta/bibliography-full.typ delete mode 100644 tests/typ/meta/bibliography-ordering.typ delete mode 100644 tests/typ/meta/bibliography.typ delete mode 100644 tests/typ/meta/cite-footnote.typ delete mode 100644 tests/typ/meta/cite-form.typ delete mode 100644 tests/typ/meta/cite-group.typ delete mode 100644 tests/typ/meta/context-compatibility.typ delete mode 100644 tests/typ/meta/context.typ delete mode 100644 tests/typ/meta/counter-page.typ delete mode 100644 tests/typ/meta/counter.typ delete mode 100644 tests/typ/meta/document.typ delete mode 100644 tests/typ/meta/figure-caption.typ delete mode 100644 tests/typ/meta/figure-localization.typ delete mode 100644 tests/typ/meta/figure.typ delete mode 100644 tests/typ/meta/footnote-break.typ delete mode 100644 tests/typ/meta/footnote-columns.typ delete mode 100644 tests/typ/meta/footnote-container.typ delete mode 100644 tests/typ/meta/footnote-invariant.typ delete mode 100644 tests/typ/meta/footnote-refs.typ delete mode 100644 tests/typ/meta/footnote-table.typ delete mode 100644 tests/typ/meta/footnote.typ delete mode 100644 tests/typ/meta/heading.typ delete mode 100644 tests/typ/meta/link.typ delete mode 100644 tests/typ/meta/numbering.typ delete mode 100644 tests/typ/meta/outline-entry.typ delete mode 100644 tests/typ/meta/outline-first-par-indent.typ delete mode 100644 tests/typ/meta/outline-indent.typ delete mode 100644 tests/typ/meta/outline.typ delete mode 100644 tests/typ/meta/page-label.typ delete mode 100644 tests/typ/meta/query-before-after.typ delete mode 100644 tests/typ/meta/query-figure.typ delete mode 100644 tests/typ/meta/query-header.typ delete mode 100644 tests/typ/meta/ref.typ delete mode 100644 tests/typ/meta/state.typ (limited to 'tests/typ/meta') diff --git a/tests/typ/meta/bibliography-full.typ b/tests/typ/meta/bibliography-full.typ deleted file mode 100644 index 9b652cd2..00000000 --- a/tests/typ/meta/bibliography-full.typ +++ /dev/null @@ -1,5 +0,0 @@ -// Test the full bibliography. - ---- -#set page(paper: "a6", height: 170mm) -#bibliography("/assets/bib/works.bib", full: true) diff --git a/tests/typ/meta/bibliography-ordering.typ b/tests/typ/meta/bibliography-ordering.typ deleted file mode 100644 index 4732ad68..00000000 --- a/tests/typ/meta/bibliography-ordering.typ +++ /dev/null @@ -1,16 +0,0 @@ -#set page(width: 300pt) - -@mcintosh_anxiety -@psychology25 -@netwok -@issue201 -@arrgh -@quark -@distress, -@glacier-melt -@issue201 -@tolkien54 -@sharing -@restful - -#bibliography("/assets/bib/works.bib") diff --git a/tests/typ/meta/bibliography.typ b/tests/typ/meta/bibliography.typ deleted file mode 100644 index 107f790e..00000000 --- a/tests/typ/meta/bibliography.typ +++ /dev/null @@ -1,44 +0,0 @@ -// Test citations and bibliographies. - ---- -#set page(width: 200pt) - -= Details -See also @arrgh #cite(, supplement: [p.~22]), @arrgh[p.~4], and @distress[p.~5]. -#bibliography("/assets/bib/works.bib") - ---- -// Test unconventional order. -#set page(width: 200pt) -#bibliography( - "/assets/bib/works.bib", - title: [Works to be cited], - style: "chicago-author-date", -) -#line(length: 100%) - -As described by #cite(, form: "prose"), -the net-work is a creature of its own. -This is close to piratery! @arrgh -And quark! @quark - ---- -#set page(width: 200pt) -#set heading(numbering: "1.") -#show bibliography: set heading(numbering: "1.") - -= Multiple Bibs -Now we have multiple bibliographies containing @glacier-melt @keshav2007read -#bibliography(("/assets/bib/works.bib", "/assets/bib/works_too.bib")) - ---- -// Test ambiguous reference. -= Introduction - -// Error: 1-7 label occurs in the document and its bibliography -@arrgh -#bibliography("/assets/bib/works.bib") - ---- -// Error: 15-65 duplicate bibliography keys: netwok, issue201, arrgh, quark, distress, glacier-melt, tolkien54, DBLP:books/lib/Knuth86a, sharing, restful, mcintosh_anxiety, psychology25 -#bibliography(("/assets/bib/works.bib", "/assets/bib/works.bib")) diff --git a/tests/typ/meta/cite-footnote.typ b/tests/typ/meta/cite-footnote.typ deleted file mode 100644 index c6eff59d..00000000 --- a/tests/typ/meta/cite-footnote.typ +++ /dev/null @@ -1,5 +0,0 @@ -Hello @netwok -And again: @netwok - -#pagebreak() -#bibliography("/assets/bib/works.bib", style: "chicago-notes") diff --git a/tests/typ/meta/cite-form.typ b/tests/typ/meta/cite-form.typ deleted file mode 100644 index 343981d7..00000000 --- a/tests/typ/meta/cite-form.typ +++ /dev/null @@ -1,10 +0,0 @@ -// Test citation forms. - ---- -#set page(width: 200pt) - -Nothing: #cite(, form: none) - -#cite(, form: "prose") say stuff. - -#bibliography("/assets/bib/works.bib", style: "apa") diff --git a/tests/typ/meta/cite-group.typ b/tests/typ/meta/cite-group.typ deleted file mode 100644 index 331c87ca..00000000 --- a/tests/typ/meta/cite-group.typ +++ /dev/null @@ -1,19 +0,0 @@ -// Test citation grouping. - ---- -A#[@netwok@arrgh]B \ -A@netwok@arrgh B \ -A@netwok @arrgh B \ -A@netwok @arrgh. B \ - -A @netwok#[@arrgh]B \ -A @netwok@arrgh, B \ -A @netwok @arrgh, B \ -A @netwok @arrgh. B \ - -A#[@netwok @arrgh @quark]B. \ -A @netwok @arrgh @quark B. \ -A @netwok @arrgh @quark, B. - -#set text(0pt) -#bibliography("/assets/bib/works.bib") diff --git a/tests/typ/meta/context-compatibility.typ b/tests/typ/meta/context-compatibility.typ deleted file mode 100644 index 60124255..00000000 --- a/tests/typ/meta/context-compatibility.typ +++ /dev/null @@ -1,29 +0,0 @@ -// Test compatibility with the pre-context way of things. -// Ref: false - ---- -#let s = state("x", 0) -#let compute(expr) = [ - #s.update(x => - eval(expr.replace("x", str(x))) - ) - New value is #s.display(). -] - -#locate(loc => { - let elem = query(, loc).first() - test(s.at(elem.location()), 13) -}) - -#compute("10") \ -#compute("x + 3") \ -*Here.* \ -#compute("x * 2") \ -#compute("x - 5") - ---- -#style(styles => measure([it], styles).width < 20pt) - ---- -#counter(heading).update(10) -#counter(heading).display(n => test(n, 10)) diff --git a/tests/typ/meta/context.typ b/tests/typ/meta/context.typ deleted file mode 100644 index 729d9fa2..00000000 --- a/tests/typ/meta/context.typ +++ /dev/null @@ -1,181 +0,0 @@ -// Test context expressions. -// Ref: false - ---- -// Test that context body is parsed as atomic expression. -#let c = [#context "hello".] -#test(c.children.first().func(), (context none).func()) -#test(c.children.last(), [.]) - ---- -// Test that manual construction is forbidden. -// Error: 2-25 cannot be constructed manually -#(context none).func()() - ---- -// Test that `here()` yields the context element's location. -#context test(query(here()).first().func(), (context none).func()) - ---- -// Test whether context is retained in nested function. -#let translate(..args) = args.named().at(text.lang) -#set text(lang: "de") -#context test(translate(de: "Inhalt", en: "Contents"), "Inhalt") - ---- -// Test whether context is retained in built-in callback. -#set text(lang: "de") -#context test( - ("en", "de", "fr").sorted(key: v => v != text.lang), - ("de", "en", "fr"), -) - ---- -// Test `locate` + `here`. -#context test(here().position().y, 10pt) - ---- -// Test `locate`. -#v(10pt) -= Introduction -#context test(locate().position().y, 20pt) - ---- -// Error: 10-25 label `` does not exist in the document -#context locate() - ---- -= Introduction -= Introduction - -// Error: 10-25 label `` occurs multiple times in the document -#context locate() - ---- -#v(10pt) -= Introduction -#context test(locate(heading).position().y, 20pt) - ---- -// Error: 10-25 selector does not match any element -#context locate(heading) - ---- -= Introduction -= Introduction - -// Error: 10-25 selector matches multiple elements -#context locate(heading) - ---- -// Test `counter`. -#let c = counter("heading") -#c.update(2) -#c.update(n => n + 2) -#context test(c.get(), (4,)) -#c.update(n => n - 3) -#context test(c.at(here()), (1,)) - ---- -// Test `state.at` outside of context. -// Error: 2-26 can only be used when context is known -// Hint: 2-26 try wrapping this in a `context` expression -// Hint: 2-26 the `context` expression should wrap everything that depends on this function -#state("key").at(