From 8f68bc7a8ea619af12d95bec7025bd9f3a86625f Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 13 Feb 2023 16:50:57 +0100 Subject: Dissolve basics folder --- tests/ref/basics/enum.png | Bin 30313 -> 0 bytes tests/ref/basics/heading.png | Bin 26270 -> 0 bytes tests/ref/basics/list-attach.png | Bin 11016 -> 0 bytes tests/ref/basics/list.png | Bin 20936 -> 0 bytes tests/ref/basics/table.png | Bin 4295 -> 0 bytes tests/ref/basics/terms.png | Bin 17233 -> 0 bytes tests/ref/layout/enum.png | Bin 0 -> 8462 bytes tests/ref/layout/list-attach.png | Bin 0 -> 11016 bytes tests/ref/layout/list.png | Bin 0 -> 20936 bytes tests/ref/layout/table.png | Bin 0 -> 4295 bytes tests/ref/layout/terms.png | Bin 0 -> 17233 bytes tests/ref/meta/heading.png | Bin 0 -> 26270 bytes tests/typ/basics/enum.typ | 69 --------------------------------------- tests/typ/basics/heading.typ | 53 ------------------------------ tests/typ/basics/list-attach.typ | 54 ------------------------------ tests/typ/basics/list.typ | 56 ------------------------------- tests/typ/basics/table.typ | 22 ------------- tests/typ/basics/terms.typ | 52 ----------------------------- tests/typ/layout/enum.typ | 28 ++++++++++++++++ tests/typ/layout/list-attach.typ | 54 ++++++++++++++++++++++++++++++ tests/typ/layout/list.typ | 56 +++++++++++++++++++++++++++++++ tests/typ/layout/table.typ | 22 +++++++++++++ tests/typ/layout/terms.typ | 52 +++++++++++++++++++++++++++++ tests/typ/meta/heading.typ | 53 ++++++++++++++++++++++++++++++ 24 files changed, 265 insertions(+), 306 deletions(-) delete mode 100644 tests/ref/basics/enum.png delete mode 100644 tests/ref/basics/heading.png delete mode 100644 tests/ref/basics/list-attach.png delete mode 100644 tests/ref/basics/list.png delete mode 100644 tests/ref/basics/table.png delete mode 100644 tests/ref/basics/terms.png create mode 100644 tests/ref/layout/enum.png create mode 100644 tests/ref/layout/list-attach.png create mode 100644 tests/ref/layout/list.png create mode 100644 tests/ref/layout/table.png create mode 100644 tests/ref/layout/terms.png create mode 100644 tests/ref/meta/heading.png delete mode 100644 tests/typ/basics/enum.typ delete mode 100644 tests/typ/basics/heading.typ delete mode 100644 tests/typ/basics/list-attach.typ delete mode 100644 tests/typ/basics/list.typ delete mode 100644 tests/typ/basics/table.typ delete mode 100644 tests/typ/basics/terms.typ create mode 100644 tests/typ/layout/enum.typ create mode 100644 tests/typ/layout/list-attach.typ create mode 100644 tests/typ/layout/list.typ create mode 100644 tests/typ/layout/table.typ create mode 100644 tests/typ/layout/terms.typ create mode 100644 tests/typ/meta/heading.typ diff --git a/tests/ref/basics/enum.png b/tests/ref/basics/enum.png deleted file mode 100644 index 8e48076b..00000000 Binary files a/tests/ref/basics/enum.png and /dev/null differ diff --git a/tests/ref/basics/heading.png b/tests/ref/basics/heading.png deleted file mode 100644 index b4f99665..00000000 Binary files a/tests/ref/basics/heading.png and /dev/null differ diff --git a/tests/ref/basics/list-attach.png b/tests/ref/basics/list-attach.png deleted file mode 100644 index 9b0e4c68..00000000 Binary files a/tests/ref/basics/list-attach.png and /dev/null differ diff --git a/tests/ref/basics/list.png b/tests/ref/basics/list.png deleted file mode 100644 index 6db5fb71..00000000 Binary files a/tests/ref/basics/list.png and /dev/null differ diff --git a/tests/ref/basics/table.png b/tests/ref/basics/table.png deleted file mode 100644 index f50f613b..00000000 Binary files a/tests/ref/basics/table.png and /dev/null differ diff --git a/tests/ref/basics/terms.png b/tests/ref/basics/terms.png deleted file mode 100644 index 5c695795..00000000 Binary files a/tests/ref/basics/terms.png and /dev/null differ diff --git a/tests/ref/layout/enum.png b/tests/ref/layout/enum.png new file mode 100644 index 00000000..97c3f7a7 Binary files /dev/null and b/tests/ref/layout/enum.png differ diff --git a/tests/ref/layout/list-attach.png b/tests/ref/layout/list-attach.png new file mode 100644 index 00000000..9b0e4c68 Binary files /dev/null and b/tests/ref/layout/list-attach.png differ diff --git a/tests/ref/layout/list.png b/tests/ref/layout/list.png new file mode 100644 index 00000000..6db5fb71 Binary files /dev/null and b/tests/ref/layout/list.png differ diff --git a/tests/ref/layout/table.png b/tests/ref/layout/table.png new file mode 100644 index 00000000..f50f613b Binary files /dev/null and b/tests/ref/layout/table.png differ diff --git a/tests/ref/layout/terms.png b/tests/ref/layout/terms.png new file mode 100644 index 00000000..5c695795 Binary files /dev/null and b/tests/ref/layout/terms.png differ diff --git a/tests/ref/meta/heading.png b/tests/ref/meta/heading.png new file mode 100644 index 00000000..b4f99665 Binary files /dev/null and b/tests/ref/meta/heading.png differ diff --git a/tests/typ/basics/enum.typ b/tests/typ/basics/enum.typ deleted file mode 100644 index fd845c2b..00000000 --- a/tests/typ/basics/enum.typ +++ /dev/null @@ -1,69 +0,0 @@ -// Test enumerations. - ---- -#enum[Embrace][Extend][Extinguish] - ---- -1. First. - 2. Indented - -+ Second - ---- -// Test automatic numbering in summed content. -#for i in range(5) { - [+ #numbering("I", 1 + i)] -} - ---- -// Test label pattern. -#set enum(numbering: "~ A:") -1. First - + Second - -#set enum(numbering: "(*)") -+ A -+ B -+ C - -#set enum(numbering: "i)") -+ A -+ B - ---- -// Mix of different lists -- Bullet List -+ Numbered List -/ Term: List - ---- -// Test numbering with closure. -#enum( - start: 4, - spacing: 0.65em - 3pt, - tight: false, - numbering: n => text( - fill: (red, green, blue).at(calc.mod(n, 3)), - numbering("A", n), - ), - [Red], [Green], [Blue], -) - ---- -#set enum(numbering: n => n > 1) -+ A -+ B - ---- -// Edge cases. -+ -Empty -+Nope - ---- -// Error: 22-24 invalid numbering pattern -#set enum(numbering: "") - ---- -// Error: 22-28 invalid numbering pattern -#set enum(numbering: "(())") diff --git a/tests/typ/basics/heading.typ b/tests/typ/basics/heading.typ deleted file mode 100644 index 3d637036..00000000 --- a/tests/typ/basics/heading.typ +++ /dev/null @@ -1,53 +0,0 @@ -// Test headings. - ---- -// Different number of equals signs. - -= Level 1 -== Level 2 -=== Level 3 - -// After three, it stops shrinking. -=========== Level 11 - ---- -// Heading vs. no heading. - -// Parsed as headings if at start of the context. -/**/ = Level 1 -#{[== Level 2]} -#box[=== Level 3] - -// Not at the start of the context. -No = heading - -// Escaped. -\= No heading - ---- -// Blocks can continue the heading. - -= #[This -is -multiline. -] - -= This - is not. - ---- -// Test styling. -#show heading.where(level: 5): it => block( - text(family: "Roboto", fill: eastern, it.title + [!]) -) - -= Heading -===== Heading 🌍 -#heading(level: 5)[Heading] - ---- -// Edge cases. -#set heading(numbering: "1.") -= -Not in heading -=Nope diff --git a/tests/typ/basics/list-attach.typ b/tests/typ/basics/list-attach.typ deleted file mode 100644 index 9d043eb0..00000000 --- a/tests/typ/basics/list-attach.typ +++ /dev/null @@ -1,54 +0,0 @@ -// Test list attaching. - ---- -// Test basic attached list. -Attached to: -- the bottom -- of the paragraph - -Next paragraph. - ---- -// Test that attached list isn't affected by block spacing. -#show list: set block(above: 100pt) -Hello -- A -World -- B - ---- -// Test non-attached list followed by attached list, -// separated by only word. -Hello - -- A - -World -- B - ---- -// Test non-attached tight list. -#set block(spacing: 15pt) -Hello -- A -World - -- B -- C - -More. - ---- -// Test that wide lists cannot be ... -#set block(spacing: 15pt) -Hello -- A - -- B -World - ---- -// ... even if forced to. -Hello -#list(tight: false)[A][B] -World diff --git a/tests/typ/basics/list.typ b/tests/typ/basics/list.typ deleted file mode 100644 index 3fd9ddb1..00000000 --- a/tests/typ/basics/list.typ +++ /dev/null @@ -1,56 +0,0 @@ -// Test bullet lists. - ---- -_Shopping list_ -#list[Apples][Potatoes][Juice] - ---- -- First level. - - - Second level. - There are multiple paragraphs. - - - Third level. - - Still the same bullet point. - - - Still level 2. - -- At the top. - ---- -- Level 1 - - Level #[ -2 through content block -] - ---- - - Top-level indent -- is fine. - ---- - - A - - B - - C -- D - ---- -// This works because tabs are used consistently. - - A with 1 tab - - B with 2 tabs - ---- -// This doesn't work because of mixed tabs and spaces. - - A with 2 spaces - - B with 2 tabs - ---- -#set list(marker: [-]) -- Bare hyphen -- is not a list - ---- -// Edge cases. -- -Not in list --Nope diff --git a/tests/typ/basics/table.typ b/tests/typ/basics/table.typ deleted file mode 100644 index 5d423e03..00000000 --- a/tests/typ/basics/table.typ +++ /dev/null @@ -1,22 +0,0 @@ -// Test tables. - ---- -#set page(height: 70pt) -#set table(fill: (x, y) => if calc.even(x + y) { rgb("aaa") }) - -#table( - columns: (1fr,) * 3, - stroke: 2pt + rgb("333"), - [A], [B], [C], [], [], [D \ E \ F \ \ \ G], [H], -) - ---- -#table(columns: 3, stroke: none, fill: green, [A], [B], [C]) - ---- -// Ref: false -#table() - ---- -// Error: 14-19 expected color, none, or function, found string -#table(fill: "hey") diff --git a/tests/typ/basics/terms.typ b/tests/typ/basics/terms.typ deleted file mode 100644 index 57864423..00000000 --- a/tests/typ/basics/terms.typ +++ /dev/null @@ -1,52 +0,0 @@ -// Test term list. - ---- -// Test with constructor. -#terms( - ([One], [First]), - ([Two], [Second]), -) - ---- -// Test joining. -#for word in lorem(4).split().map(s => s.trim(".")) [ - / #word: Latin stuff. -] - ---- -// Test multiline. -#set text(8pt) - -/ Fruit: A tasty, edible thing. -/ Veggie: - An important energy source - for vegetarians. - ---- -// Test style change. -#set text(8pt) -/ First list: #lorem(4) - -#set terms(hanging-indent: 30pt) -/ Second list: #lorem(4) - ---- -// Test grid like show rule. -#show terms: it => table( - columns: 2, - inset: 3pt, - ..it.items.map(item => (emph(item.at(0)), item.at(1))).flatten(), -) - -/ A: One letter -/ BB: Two letters -/ CCC: Three letters - ---- -/ Term: -Not in list -/Nope - ---- -// Error: 8 expected colon -/ Hello diff --git a/tests/typ/layout/enum.typ b/tests/typ/layout/enum.typ new file mode 100644 index 00000000..9512e1b5 --- /dev/null +++ b/tests/typ/layout/enum.typ @@ -0,0 +1,28 @@ +// Test enumerations. + +--- +#enum[Embrace][Extend][Extinguish] + +--- +1. First. + 2. Indented + ++ Second + +--- +// Test automatic numbering in summed content. +#for i in range(5) { + [+ #numbering("I", 1 + i)] +} + +--- +// Mix of different lists +- Bullet List ++ Numbered List +/ Term: List + +--- +// Edge cases. ++ +Empty ++Nope diff --git a/tests/typ/layout/list-attach.typ b/tests/typ/layout/list-attach.typ new file mode 100644 index 00000000..9d043eb0 --- /dev/null +++ b/tests/typ/layout/list-attach.typ @@ -0,0 +1,54 @@ +// Test list attaching. + +--- +// Test basic attached list. +Attached to: +- the bottom +- of the paragraph + +Next paragraph. + +--- +// Test that attached list isn't affected by block spacing. +#show list: set block(above: 100pt) +Hello +- A +World +- B + +--- +// Test non-attached list followed by attached list, +// separated by only word. +Hello + +- A + +World +- B + +--- +// Test non-attached tight list. +#set block(spacing: 15pt) +Hello +- A +World + +- B +- C + +More. + +--- +// Test that wide lists cannot be ... +#set block(spacing: 15pt) +Hello +- A + +- B +World + +--- +// ... even if forced to. +Hello +#list(tight: false)[A][B] +World diff --git a/tests/typ/layout/list.typ b/tests/typ/layout/list.typ new file mode 100644 index 00000000..3fd9ddb1 --- /dev/null +++ b/tests/typ/layout/list.typ @@ -0,0 +1,56 @@ +// Test bullet lists. + +--- +_Shopping list_ +#list[Apples][Potatoes][Juice] + +--- +- First level. + + - Second level. + There are multiple paragraphs. + + - Third level. + + Still the same bullet point. + + - Still level 2. + +- At the top. + +--- +- Level 1 + - Level #[ +2 through content block +] + +--- + - Top-level indent +- is fine. + +--- + - A + - B + - C +- D + +--- +// This works because tabs are used consistently. + - A with 1 tab + - B with 2 tabs + +--- +// This doesn't work because of mixed tabs and spaces. + - A with 2 spaces + - B with 2 tabs + +--- +#set list(marker: [-]) +- Bare hyphen +- is not a list + +--- +// Edge cases. +- +Not in list +-Nope diff --git a/tests/typ/layout/table.typ b/tests/typ/layout/table.typ new file mode 100644 index 00000000..5d423e03 --- /dev/null +++ b/tests/typ/layout/table.typ @@ -0,0 +1,22 @@ +// Test tables. + +--- +#set page(height: 70pt) +#set table(fill: (x, y) => if calc.even(x + y) { rgb("aaa") }) + +#table( + columns: (1fr,) * 3, + stroke: 2pt + rgb("333"), + [A], [B], [C], [], [], [D \ E \ F \ \ \ G], [H], +) + +--- +#table(columns: 3, stroke: none, fill: green, [A], [B], [C]) + +--- +// Ref: false +#table() + +--- +// Error: 14-19 expected color, none, or function, found string +#table(fill: "hey") diff --git a/tests/typ/layout/terms.typ b/tests/typ/layout/terms.typ new file mode 100644 index 00000000..57864423 --- /dev/null +++ b/tests/typ/layout/terms.typ @@ -0,0 +1,52 @@ +// Test term list. + +--- +// Test with constructor. +#terms( + ([One], [First]), + ([Two], [Second]), +) + +--- +// Test joining. +#for word in lorem(4).split().map(s => s.trim(".")) [ + / #word: Latin stuff. +] + +--- +// Test multiline. +#set text(8pt) + +/ Fruit: A tasty, edible thing. +/ Veggie: + An important energy source + for vegetarians. + +--- +// Test style change. +#set text(8pt) +/ First list: #lorem(4) + +#set terms(hanging-indent: 30pt) +/ Second list: #lorem(4) + +--- +// Test grid like show rule. +#show terms: it => table( + columns: 2, + inset: 3pt, + ..it.items.map(item => (emph(item.at(0)), item.at(1))).flatten(), +) + +/ A: One letter +/ BB: Two letters +/ CCC: Three letters + +--- +/ Term: +Not in list +/Nope + +--- +// Error: 8 expected colon +/ Hello diff --git a/tests/typ/meta/heading.typ b/tests/typ/meta/heading.typ new file mode 100644 index 00000000..3d637036 --- /dev/null +++ b/tests/typ/meta/heading.typ @@ -0,0 +1,53 @@ +// Test headings. + +--- +// Different number of equals signs. + += Level 1 +== Level 2 +=== Level 3 + +// After three, it stops shrinking. +=========== Level 11 + +--- +// Heading vs. no heading. + +// Parsed as headings if at start of the context. +/**/ = Level 1 +#{[== Level 2]} +#box[=== Level 3] + +// Not at the start of the context. +No = heading + +// Escaped. +\= No heading + +--- +// Blocks can continue the heading. + += #[This +is +multiline. +] + += This + is not. + +--- +// Test styling. +#show heading.where(level: 5): it => block( + text(family: "Roboto", fill: eastern, it.title + [!]) +) + += Heading +===== Heading 🌍 +#heading(level: 5)[Heading] + +--- +// Edge cases. +#set heading(numbering: "1.") += +Not in heading +=Nope -- cgit v1.2.3