diff --git a/tests/ref/code/repr.png b/tests/ref/code/repr.png index b93677f16..bc29db545 100644 Binary files a/tests/ref/code/repr.png and b/tests/ref/code/repr.png differ diff --git a/tests/ref/full/coma.png b/tests/ref/coma.png similarity index 100% rename from tests/ref/full/coma.png rename to tests/ref/coma.png diff --git a/tests/ref/library/circle.png b/tests/ref/insert/circle.png similarity index 100% rename from tests/ref/library/circle.png rename to tests/ref/insert/circle.png diff --git a/tests/ref/library/ellipse.png b/tests/ref/insert/ellipse.png similarity index 100% rename from tests/ref/library/ellipse.png rename to tests/ref/insert/ellipse.png diff --git a/tests/ref/library/image.png b/tests/ref/insert/image.png similarity index 100% rename from tests/ref/library/image.png rename to tests/ref/insert/image.png diff --git a/tests/ref/library/rect.png b/tests/ref/insert/rect.png similarity index 100% rename from tests/ref/library/rect.png rename to tests/ref/insert/rect.png diff --git a/tests/ref/library/square.png b/tests/ref/insert/square.png similarity index 100% rename from tests/ref/library/square.png rename to tests/ref/insert/square.png diff --git a/tests/ref/library/grid.png b/tests/ref/layout/grid-1.png similarity index 100% rename from tests/ref/library/grid.png rename to tests/ref/layout/grid-1.png diff --git a/tests/ref/library/grid-table.png b/tests/ref/layout/grid-2.png similarity index 100% rename from tests/ref/library/grid-table.png rename to tests/ref/layout/grid-2.png diff --git a/tests/ref/library/pad.png b/tests/ref/layout/pad.png similarity index 100% rename from tests/ref/library/pad.png rename to tests/ref/layout/pad.png diff --git a/tests/ref/library/page.png b/tests/ref/layout/page.png similarity index 100% rename from tests/ref/library/page.png rename to tests/ref/layout/page.png diff --git a/tests/ref/library/pagebreak.png b/tests/ref/layout/pagebreak.png similarity index 100% rename from tests/ref/library/pagebreak.png rename to tests/ref/layout/pagebreak.png diff --git a/tests/ref/library/spacing.png b/tests/ref/layout/spacing.png similarity index 100% rename from tests/ref/library/spacing.png rename to tests/ref/layout/spacing.png diff --git a/tests/ref/library/stack.png b/tests/ref/layout/stack.png similarity index 100% rename from tests/ref/library/stack.png rename to tests/ref/layout/stack.png diff --git a/tests/ref/library/lang.png b/tests/ref/library/lang.png deleted file mode 100644 index ecb8820a1..000000000 Binary files a/tests/ref/library/lang.png and /dev/null differ diff --git a/tests/ref/markup/basic.png b/tests/ref/markup/basic.png deleted file mode 100644 index d769a2093..000000000 Binary files a/tests/ref/markup/basic.png and /dev/null differ diff --git a/tests/ref/markup/linebreak.png b/tests/ref/markup/linebreak.png new file mode 100644 index 000000000..06f4d5f45 Binary files /dev/null and b/tests/ref/markup/linebreak.png differ diff --git a/tests/ref/markup/shorthands.png b/tests/ref/markup/shorthands.png new file mode 100644 index 000000000..3a5652ac6 Binary files /dev/null and b/tests/ref/markup/shorthands.png differ diff --git a/tests/ref/text/bidi.png b/tests/ref/text/bidi.png index 0b7a8c2bd..b90c6714d 100644 Binary files a/tests/ref/text/bidi.png and b/tests/ref/text/bidi.png differ diff --git a/tests/ref/library/font.png b/tests/ref/text/font.png similarity index 100% rename from tests/ref/library/font.png rename to tests/ref/text/font.png diff --git a/tests/ref/library/paragraph.png b/tests/ref/text/par.png similarity index 100% rename from tests/ref/library/paragraph.png rename to tests/ref/text/par.png diff --git a/tests/typ/code/repr.typ b/tests/typ/code/repr.typ index f24045107..eacbf8e81 100644 --- a/tests/typ/code/repr.typ +++ b/tests/typ/code/repr.typ @@ -2,7 +2,6 @@ --- // Variables. - #let name = "Typst" #let ke-bab = "Kebab!" #let α = "Alpha" @@ -31,9 +30,7 @@ {4.5cm} \ {12e1pt} \ {2.5rad} \ -{45deg} \ -// Not in monospace via repr. -#repr(45deg) +{45deg} --- // Colors. @@ -55,3 +52,12 @@ {rect} \ {f} \ {() => none} + +--- +// Test using the `repr` function. + +// Returns a string. +#test(repr((1, 2, false, )), "(1, 2, false)") + +// Not in monospace +#repr(23deg) diff --git a/tests/typ/full/coma.typ b/tests/typ/coma.typ similarity index 96% rename from tests/typ/full/coma.typ rename to tests/typ/coma.typ index 78a703a95..810d61b8f 100644 --- a/tests/typ/full/coma.typ +++ b/tests/typ/coma.typ @@ -46,4 +46,4 @@ von _v_ zu einem Blatt. Die Höhe des Baumes ist die Höhe der Wurzel. // The `image` function returns a "template" value of the same type as // the `[...]` literals. -#align(center, image("../../res/graph.png", width: 75%)) +#align(center, image("../res/graph.png", width: 75%)) diff --git a/tests/typ/library/circle.typ b/tests/typ/insert/circle.typ similarity index 100% rename from tests/typ/library/circle.typ rename to tests/typ/insert/circle.typ diff --git a/tests/typ/library/ellipse.typ b/tests/typ/insert/ellipse.typ similarity index 100% rename from tests/typ/library/ellipse.typ rename to tests/typ/insert/ellipse.typ diff --git a/tests/typ/library/image.typ b/tests/typ/insert/image.typ similarity index 93% rename from tests/typ/library/image.typ rename to tests/typ/insert/image.typ index 1fa128f05..35087c2ed 100644 --- a/tests/typ/library/image.typ +++ b/tests/typ/insert/image.typ @@ -13,8 +13,8 @@ // Error: 8-29 file not found #image("path/does/not/exist") -// Error: 8-20 failed to load image -#image("./font.typ") +// Error: 8-21 failed to load image +#image("./image.typ") --- // Test configuring the size and fitting behaviour of images. diff --git a/tests/typ/library/rect.typ b/tests/typ/insert/rect.typ similarity index 100% rename from tests/typ/library/rect.typ rename to tests/typ/insert/rect.typ diff --git a/tests/typ/library/square.typ b/tests/typ/insert/square.typ similarity index 100% rename from tests/typ/library/square.typ rename to tests/typ/insert/square.typ diff --git a/tests/typ/library/grid.typ b/tests/typ/layout/grid-1.typ similarity index 97% rename from tests/typ/library/grid.typ rename to tests/typ/layout/grid-1.typ index afb43684f..6a4aee870 100644 --- a/tests/typ/library/grid.typ +++ b/tests/typ/layout/grid-1.typ @@ -1,4 +1,4 @@ -// Test the `grid` function. +// Test grid layouts. --- #let rect(width, color) = rect(width: width, height: 2cm, fill: color) diff --git a/tests/typ/library/grid-table.typ b/tests/typ/layout/grid-2.typ similarity index 100% rename from tests/typ/library/grid-table.typ rename to tests/typ/layout/grid-2.typ diff --git a/tests/typ/library/pad.typ b/tests/typ/layout/pad.typ similarity index 100% rename from tests/typ/library/pad.typ rename to tests/typ/layout/pad.typ diff --git a/tests/typ/library/page.typ b/tests/typ/layout/page.typ similarity index 96% rename from tests/typ/library/page.typ rename to tests/typ/layout/page.typ index 7f9a0d2c3..cf787e5d1 100644 --- a/tests/typ/library/page.typ +++ b/tests/typ/layout/page.typ @@ -1,8 +1,6 @@ -// Test the `page` function. - ---- // Test configuring page sizes and margins. +--- // Set width and height. #page(width: 120pt, height: 120pt) #page(width: 40pt)[High] diff --git a/tests/typ/library/pagebreak.typ b/tests/typ/layout/pagebreak.typ similarity index 90% rename from tests/typ/library/pagebreak.typ rename to tests/typ/layout/pagebreak.typ index 26629f4bd..bb7013ab2 100644 --- a/tests/typ/library/pagebreak.typ +++ b/tests/typ/layout/pagebreak.typ @@ -1,4 +1,4 @@ -// Test the `pagebreak` function. +// Test forced page breaks. --- First of two diff --git a/tests/typ/library/spacing.typ b/tests/typ/layout/spacing.typ similarity index 100% rename from tests/typ/library/spacing.typ rename to tests/typ/layout/spacing.typ diff --git a/tests/typ/library/stack.typ b/tests/typ/layout/stack.typ similarity index 83% rename from tests/typ/library/stack.typ rename to tests/typ/layout/stack.typ index d03a95c8b..006a1412e 100644 --- a/tests/typ/library/stack.typ +++ b/tests/typ/layout/stack.typ @@ -1,4 +1,4 @@ -// Test the `stack` function. +// Test stack layouts. --- #let rect(width, color) = rect(width: width, height: 1cm, fill: color) diff --git a/tests/typ/library/lang.typ b/tests/typ/library/lang.typ deleted file mode 100644 index 87d2c154c..000000000 --- a/tests/typ/library/lang.typ +++ /dev/null @@ -1,16 +0,0 @@ -// Test the `lang` function. - ---- -Left to right. - -#lang("ar") -Right to left. - -#lang(dir: ltr) -Back again. - ---- -// Ref: false - -// Error: 12-15 must be horizontal -#lang(dir: ttb) diff --git a/tests/typ/markup/basic.typ b/tests/typ/markup/basic.typ deleted file mode 100644 index 01582ceb1..000000000 --- a/tests/typ/markup/basic.typ +++ /dev/null @@ -1,12 +0,0 @@ -// Test basic markup. - ---- -A \ B \ C - ---- -Paragraph breaks - -for you! - ---- -The non-breaking~space does work. diff --git a/tests/typ/markup/linebreak.typ b/tests/typ/markup/linebreak.typ new file mode 100644 index 000000000..7fe8a7188 --- /dev/null +++ b/tests/typ/markup/linebreak.typ @@ -0,0 +1,4 @@ +// Test line breaks. + +--- +A \ B \ C diff --git a/tests/typ/markup/shorthands.typ b/tests/typ/markup/shorthands.typ new file mode 100644 index 000000000..38471c9d9 --- /dev/null +++ b/tests/typ/markup/shorthands.typ @@ -0,0 +1,7 @@ +// Test shorthands for unicode codepoints. + +--- +The non-breaking~space does work. + +--- +En dash: -- diff --git a/tests/typ/text/bidi.typ b/tests/typ/text/bidi.typ index 0d5899305..078cb1f98 100644 --- a/tests/typ/text/bidi.typ +++ b/tests/typ/text/bidi.typ @@ -1,27 +1,27 @@ -// Test bidirectional text. +// Test bidirectional text and language configuration. --- // Test reordering with different top-level paragraph directions. #let text = [Text טֶקסט] #font("EB Garamond", "Noto Serif Hebrew") -#lang("de") {text} #lang("he") {text} +#lang("de") {text} --- -// Test that consecutiv, embedded LTR runs stay LTR. +// Test that consecutive, embedded LTR runs stay LTR. // Here, we have two runs: "A" and italic "B". #let text = [أنت A_B_مطرC] #font("EB Garamond", "Noto Sans Arabic") -#lang("de") {text} #lang("ar") {text} +#lang("de") {text} --- // Test that consecutive, embedded RTL runs stay RTL. // Here, we have three runs: "גֶ", bold "שֶׁ", and "ם". #let text = [Aגֶ*שֶׁ*םB] #font("EB Garamond", "Noto Serif Hebrew") -#lang("de") {text} #lang("he") {text} +#lang("de") {text} --- // Test embedding up to level 4 with isolates. @@ -47,3 +47,10 @@ Lריווח #h(1cm) R #font("Noto Serif Hebrew", "EB Garamond") #lang("he") קרנפיםRh#image("../../res/rhino.png", height: 11pt)inoחיים + +--- +// Test the `lang` function. +// Ref: false + +// Error: 12-15 must be horizontal +#lang(dir: ttb) diff --git a/tests/typ/library/font.typ b/tests/typ/text/font.typ similarity index 98% rename from tests/typ/library/font.typ rename to tests/typ/text/font.typ index 34b08f26c..317037e2c 100644 --- a/tests/typ/library/font.typ +++ b/tests/typ/text/font.typ @@ -1,8 +1,6 @@ -// Test the `font` function. - ---- // Test configuring font properties. +--- // Set same font size in three different ways. #font(22pt)[A] #font(200%)[A] diff --git a/tests/typ/library/paragraph.typ b/tests/typ/text/par.typ similarity index 90% rename from tests/typ/library/paragraph.typ rename to tests/typ/text/par.typ index a26aed840..4ce2f6f14 100644 --- a/tests/typ/library/paragraph.typ +++ b/tests/typ/text/par.typ @@ -1,8 +1,6 @@ -// Test the `paragraph` function. - ---- // Test configuring paragraph properties. +--- // FIXME: Word spacing doesn't work due to new shaping process. #par(spacing: 10pt, leading: 25%, word-spacing: 1pt) diff --git a/tests/typ/library/math.typ b/tests/typ/utility/calc.typ similarity index 88% rename from tests/typ/library/math.typ rename to tests/typ/utility/calc.typ index db234d9c0..3bfc98024 100644 --- a/tests/typ/library/math.typ +++ b/tests/typ/utility/calc.typ @@ -1,4 +1,4 @@ -// Test math functions. +// Test basic calculation functions. // Ref: false --- diff --git a/tests/typ/library/basic.typ b/tests/typ/utility/color.typ similarity index 83% rename from tests/typ/library/basic.typ rename to tests/typ/utility/color.typ index a6aa71afb..2e40828b4 100644 --- a/tests/typ/library/basic.typ +++ b/tests/typ/utility/color.typ @@ -1,10 +1,6 @@ -// Test basic functions. +// Test color creation functions. // Ref: false ---- -#test(type("hi"), "string") -#test(repr((1, 2, false, )), "(1, 2, false)") - --- // Check the output. #test(rgb(0.0, 0.3, 0.7), #004db3)