From 2f4dc99cec1c6fa33257dea91ab3bcd99b1cbdf5 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 17 Feb 2021 21:30:20 +0100 Subject: [PATCH] =?UTF-8?q?Refresh=20tests=20=F0=9F=8C=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/full/typ/coma.typ | 16 ++--- tests/lang/ref/call-bracket.png | Bin 12516 -> 0 bytes tests/lang/typ/array.typ | 6 +- tests/lang/typ/block-invalid.typ | 18 ++--- tests/lang/typ/block-scoping.typ | 14 ++-- tests/lang/typ/block-value.typ | 16 ++--- tests/lang/typ/call-args.typ | 28 ++++---- tests/lang/typ/call-bracket.typ | 48 ------------- tests/lang/typ/call-invalid.typ | 38 ++++------- tests/lang/typ/call-paren.typ | 11 --- tests/lang/typ/call-value.typ | 14 ++++ tests/lang/typ/comment.typ | 4 +- tests/lang/typ/dict.typ | 2 +- tests/lang/typ/escape.typ | 2 +- tests/lang/typ/expr-assoc.typ | 10 +-- tests/lang/typ/expr-binary.typ | 108 +++++++++++++++--------------- tests/lang/typ/expr-invalid.typ | 12 ++-- tests/lang/typ/expr-prec.typ | 16 ++--- tests/lang/typ/expr-unary.typ | 8 +-- tests/lang/typ/for-invalid.typ | 29 ++++---- tests/lang/typ/for-loop.typ | 33 ++++----- tests/lang/typ/for-pattern.typ | 10 +-- tests/lang/typ/for-value.typ | 14 ++-- tests/lang/typ/heading.typ | 6 +- tests/lang/typ/if-branch.typ | 2 +- tests/lang/typ/if-invalid.typ | 14 ++-- tests/lang/typ/if-value.typ | 12 ++-- tests/lang/typ/let-invalid.typ | 6 +- tests/lang/typ/let-terminated.typ | 16 ++--- tests/lang/typ/let-value.typ | 4 +- tests/lang/typ/raw.typ | 2 +- tests/lang/typ/spacing.typ | 14 ++-- tests/lang/typ/strong.typ | 2 +- tests/library/typ/box.typ | 16 ++--- tests/library/typ/font.typ | 46 ++++++------- tests/library/typ/hv.typ | 18 ++--- tests/library/typ/image.typ | 26 +++---- tests/library/typ/page.typ | 52 +++++++------- tests/library/typ/pagebreak.typ | 4 +- tests/library/typ/rgb.typ | 16 ++--- tests/typeset.rs | 4 +- 41 files changed, 328 insertions(+), 389 deletions(-) delete mode 100644 tests/lang/ref/call-bracket.png delete mode 100644 tests/lang/typ/call-bracket.typ delete mode 100644 tests/lang/typ/call-paren.typ create mode 100644 tests/lang/typ/call-value.typ diff --git a/tests/full/typ/coma.typ b/tests/full/typ/coma.typ index 32990997c..7cf62da72 100644 --- a/tests/full/typ/coma.typ +++ b/tests/full/typ/coma.typ @@ -1,23 +1,23 @@ -#[page width: 450pt, height: 300pt, margins: 1cm] +#page(width: 450pt, height: 300pt, margins: 1cm) -#[box][ +#box[ *Technische Universität Berlin* \ *Fakultät II, Institut for Mathematik* \ Sekretariat MA \ Dr. Max Mustermann \ Ola Nordmann, John Doe ] -#[align right | box][*WiSe 2019/2020* \ Woche 3] +#align(right, box[*WiSe 2019/2020* \ Woche 3]) -#[v 6mm] +#v(6mm) -#[align center][ - ==== 3. Übungsblatt Computerorientierte Mathematik II #[v 2mm] - *Abgabe: 03.05.2019* (bis 10:10 Uhr in MA 001) #[v 2mm] +#align(center)[ + ==== 3. Übungsblatt Computerorientierte Mathematik II #v(2mm) + *Abgabe: 03.05.2019* (bis 10:10 Uhr in MA 001) #v(2mm) *Alle Antworten sind zu beweisen.* ] -*1. Aufgabe* #[align right][(1 + 1 + 2 Punkte)] +*1. Aufgabe* #align(right)[(1 + 1 + 2 Punkte)] Ein _Binärbaum_ ist ein Wurzelbaum, in dem jeder Knoten ≤ 2 Kinder hat. Die Tiefe eines Knotens _v_ ist die Länge des eindeutigen Weges von der Wurzel diff --git a/tests/lang/ref/call-bracket.png b/tests/lang/ref/call-bracket.png deleted file mode 100644 index b5b2f767936f3c88022aae6bee88a0dbc981aa97..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12516 zcmcI~XH*k`wr(f_Vo(G`0#c-RF!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X^AmahYCCLU2(3Q#ukK36^Q86&fZm@c9_VjzwdStknTc${$uzP#|OH zm$~t;4pJRi@c&8K`Y$2y&j{JyNcGDU@-`+qLjwAkujonXETOBtgevZ+Q{|8fW_+qy zthaqFHH08I?sFtS6f%9J?6a<31om4`B7P|sq$_DSFEBxeH&|K|7Y)t3|F}&sn6tpB z;E=+uPRXGycX0$jRm6OaasNtZDldYl!OK7_$5(-clbImY?g&wox$?<+ej%2*@cIZ?5C7(H` z`Xk8-og#MQ_$9hCt4gv%mk1|T6+%_15P%ZST!SDUA1e1_)*X8a19AP!q9+!h!x4bF zA#gy$s&R)PW^EjKAdp)$!|1picD%3lYfOrj8@C~#((jYpzrOmJ%Z@WJnV{j#x* zmV}UKj87U<4BN0~;&ax-HH5B`iRbpczt{laqA#j=A_1cOZAG_L0$oHu`l+=JKlm?w zQfUCh;!hHx!KW$lPVNQ?uM!A%tQi2QNwEM09uoqW8y4IDoUSNh#_bu3pDO z*n()R6I0{f1NS`JhKSQ;9qL4Yt5$ubYYocd31i=M7cXAr-q;uw!3h`Dlj~#06lWIt z-SL+rxF{}7I(PptVHct8?#Um1>GPwU{Ki(%-J0#* z&O|^GsH8&--Txc!q~LhVB)C?|gs!O(in9j${;i)n%2h%Y;J5+en~4ngSbzqw`Y~+D zpkU0$Ufzj8mHaG8@gD3B#A=x2>@Ar2b5XEx(}9Vcmp_UmxoKR-gB#F9W4h(K<9TL6Y_*uQ1|~f<^Tylp!57!vCTh2?w=y~UQkCh hApHN|e*4Iqd;A=uZ)l}L6aHRQQP6l+E@u(?zW{tRM-~78 diff --git a/tests/lang/typ/array.typ b/tests/lang/typ/array.typ index f80cc0cd4..b17b722c5 100644 --- a/tests/lang/typ/array.typ +++ b/tests/lang/typ/array.typ @@ -19,13 +19,13 @@ , #003 ,)} -// Error: 3-3 expected closing paren +// Error: 3 expected closing paren {(} // Error: 2-3 expected expression, found closing paren {)} -// Error: 2:4-2:4 expected comma +// Error: 2:4 expected comma // Error: 1:4-1:6 expected expression, found end of block comment {(1*/2)} @@ -36,7 +36,7 @@ {(,1)} // Missing expression makes named pair incomplete, making this an empty array. -// Error: 5-5 expected expression +// Error: 5 expected expression {(a:)} // Named pair after this is already identified as an array. diff --git a/tests/lang/typ/block-invalid.typ b/tests/lang/typ/block-invalid.typ index cf51b91b0..288748612 100644 --- a/tests/lang/typ/block-invalid.typ +++ b/tests/lang/typ/block-invalid.typ @@ -7,28 +7,28 @@ {1u} // Should output `1`. -// Error: 3-3 expected semicolon or line break +// Error: 3 expected semicolon or line break {0 1} // Should output `2`. -// Error: 2:13-2:13 expected semicolon or line break -// Error: 1:24-1:24 expected semicolon or line break -{#let x = -1 #let y = 3 x + y} +// Error: 2:12 expected semicolon or line break +// Error: 1:22 expected semicolon or line break +{let x = -1 let y = 3 x + y} // Should output `3`. { - // Error: 10-13 expected identifier, found string - #for "v" + // Error: 9-12 expected identifier, found string + for "v" - // Error: 11-11 expected keyword `#in` - #for v #let z = 1 + 2 + // Error: 10 expected keyword `#in` + for v let z = 1 + 2 z } --- // Ref: false -// Error: 3:1-3:1 expected closing brace +// Error: 3:1 expected closing brace { --- diff --git a/tests/lang/typ/block-scoping.typ b/tests/lang/typ/block-scoping.typ index bd1f58675..7bb98969a 100644 --- a/tests/lang/typ/block-scoping.typ +++ b/tests/lang/typ/block-scoping.typ @@ -3,17 +3,17 @@ --- // Block in template does not create a scope. -{ #let x = 1 } -#[test x, 1] +{ let x = 1 } +#test(x, 1) --- // Block in expression does create a scope. #let a = { - #let b = 1 + let b = 1 b } -#[test a, 1] +#test(a, 1) // Error: 2-3 unknown variable {b} @@ -21,12 +21,12 @@ --- // Multiple nested scopes. { - #let a = "a1" + let a = "a1" { - #let a = "a2" + let a = "a2" { test(a, "a2") - #let a = "a3" + let a = "a3" test(a, "a3") } test(a, "a2") diff --git a/tests/lang/typ/block-value.typ b/tests/lang/typ/block-value.typ index 62934ce67..4a075c03d 100644 --- a/tests/lang/typ/block-value.typ +++ b/tests/lang/typ/block-value.typ @@ -7,7 +7,7 @@ All none {} // Let evaluates to none. -{ #let v = 0 } +{ let v = 0 } // Trailing none evaluates to none. { @@ -20,19 +20,19 @@ All none { "Hello" } // Evaluates to trailing expression. -{ #let x = "Hel"; x + "lo" } +{ let x = "Hel"; x + "lo" } // Evaluates to concatenation of for loop bodies. { - #let parts = ("Hel", "lo") - #for s #in parts [{s}] + let parts = ("Hel", "lo") + for s in parts [{s}] } --- // Works the same way in code environment. // Ref: false -#[test { - #let x = 1 - #let y = 2 +#test(3, { + let x = 1 + let y = 2 x + y -}, 3] +}) diff --git a/tests/lang/typ/call-args.typ b/tests/lang/typ/call-args.typ index cf79c1f02..53ae0b974 100644 --- a/tests/lang/typ/call-args.typ +++ b/tests/lang/typ/call-args.typ @@ -2,33 +2,33 @@ --- // One argument. -#[f bold] +#f(bold) // One argument and trailing comma. -#[f 1,] +#f(1,) // One named argument. -#[f a:2] +#f(a:2) // Mixed arguments. {f(1, a: (3, 4), 2, b: "5")} --- -// Error: 5-6 expected expression, found colon -#[f :] +// Error: 4-5 expected expression, found colon +#f(:) -// Error: 8-10 expected expression, found end of block comment -#[f a:1*/] +// Error: 7-9 expected expression, found end of block comment +#f(a:1*/) -// Error: 6-6 expected comma -#[f 1 2] +// Error: 5 expected comma +#f(1 2) -// Error: 2:5-2:6 expected identifier -// Error: 1:7-1:7 expected expression -#[f 1:] +// Error: 2:4-2:5 expected identifier +// Error: 1:6 expected expression +#f(1:) -// Error: 5-6 expected identifier -#[f 1:2] +// Error: 4-5 expected identifier +#f(1:2) // Error: 4-7 expected identifier {f((x):1)} diff --git a/tests/lang/typ/call-bracket.typ b/tests/lang/typ/call-bracket.typ deleted file mode 100644 index eb0970941..000000000 --- a/tests/lang/typ/call-bracket.typ +++ /dev/null @@ -1,48 +0,0 @@ -// Test bracketed function calls. - ---- -// Whitespace is insignificant. -#[ f ] - -// Alternatives for embedding. -#[f f()], #[f #[f]], #[f][#[f]], - -// Tight functions. -#[f]#[f] - -// Multi-paragraph body. -#[align right][ - First - - Second -] - ---- -// Chained once. -#[f | f] - -// Chained twice. -#[f|f|f] - -// With body. -// Error: 7-8 expected identifier, found integer -#[f | 1 | box][💕] - -// With actual functions. -#[box width: 1cm | image "res/rhino.png"] - ---- -// Error: 8-8 expected identifier -#[f 1 |] - -// Error: 4-4 expected identifier -#[ | f true] - -// Error: 2:3-2:3 expected identifier -// Error: 1:4-1:4 expected identifier -#[|][Nope] - -// Pipe wins over parens. -// Error: 2:6-2:6 expected closing paren -// Error: 1:9-1:10 expected expression, found closing paren -#[f (|f )] diff --git a/tests/lang/typ/call-invalid.typ b/tests/lang/typ/call-invalid.typ index 8e3efa328..a04f59592 100644 --- a/tests/lang/typ/call-invalid.typ +++ b/tests/lang/typ/call-invalid.typ @@ -1,36 +1,24 @@ // Test invalid function calls. --- -// Error: 4-4 expected closing paren -{f(} - ---- -// Error: 4:1-4:1 expected identifier -// Error: 3:1-3:1 expected closing bracket -#[ - ---- -// Error: 3-3 expected identifier -#[] - -// Error: 3-6 expected identifier, found string -#["f"] - -// Error: 2:3-2:4 expected identifier, found opening paren -// Error: 1:5-1:6 expected expression, found closing paren -#[(f)] +// Error: 1-2 unexpected invalid token +# --- #let x = "string" -// Error: 3-4 expected function, found string -#[x] +// Error: 2-3 expected function, found string +#x() --- -// Error: 3:1-3:1 expected closing bracket -#[f][`a]` +// Error: 3:1 expected closing bracket +#f[`a]` --- -// Error: 3:1-3:1 expected quote -// Error: 2:1-2:1 expected closing bracket -#[f "] +// Error: 4 expected closing paren +{f(} + +--- +// Error: 3:1 expected quote +// Error: 2:1 expected closing bracket +#f("] diff --git a/tests/lang/typ/call-paren.typ b/tests/lang/typ/call-paren.typ deleted file mode 100644 index 482e20e83..000000000 --- a/tests/lang/typ/call-paren.typ +++ /dev/null @@ -1,11 +0,0 @@ -// Test parenthesized function calls. -// Ref: false - ---- -// Whitespace insignificant. -#[test type(1), "integer"] -#[test type (1), "integer"] - -// From variable. -#let alias = type -#[test alias(alias), "function"] diff --git a/tests/lang/typ/call-value.typ b/tests/lang/typ/call-value.typ new file mode 100644 index 000000000..0e2577170 --- /dev/null +++ b/tests/lang/typ/call-value.typ @@ -0,0 +1,14 @@ +// Test function calls. +// Ref: false + +--- +// Whitespace is insignificant. +#test(type(1), "integer") +#test (type (1), "integer") + +// From variable. +#let alias = type +#test(alias(alias), "function") + +// Returns template. +#test(type(font(12pt)), "template") diff --git a/tests/lang/typ/comment.typ b/tests/lang/typ/comment.typ index 8b394f1fe..e58924532 100644 --- a/tests/lang/typ/comment.typ +++ b/tests/lang/typ/comment.typ @@ -11,8 +11,8 @@ C/* */D // Works in code. -#[test type /*1*/ (1) // -, "integer"] +#test(type /*1*/ (1) // +, "integer") --- // End should not appear without start. diff --git a/tests/lang/typ/dict.typ b/tests/lang/typ/dict.typ index b12dbd590..076a572f0 100644 --- a/tests/lang/typ/dict.typ +++ b/tests/lang/typ/dict.typ @@ -14,7 +14,7 @@ // Identified as dictionary due to initial colon. // Error: 4:4-4:5 expected named pair, found expression -// Error: 3:5-3:5 expected comma +// Error: 3:5 expected comma // Error: 2:12-2:16 expected identifier // Error: 1:17-1:18 expected expression, found colon {(:1 b:[], true::)} diff --git a/tests/lang/typ/escape.typ b/tests/lang/typ/escape.typ index 3c0f02f38..eeac4997f 100644 --- a/tests/lang/typ/escape.typ +++ b/tests/lang/typ/escape.typ @@ -26,5 +26,5 @@ \u{FFFFFF} // Unterminated. -// Error: 6-6 expected closing brace +// Error: 6 expected closing brace \u{41*Bold* diff --git a/tests/lang/typ/expr-assoc.typ b/tests/lang/typ/expr-assoc.typ index 64db98c68..19c56951e 100644 --- a/tests/lang/typ/expr-assoc.typ +++ b/tests/lang/typ/expr-assoc.typ @@ -3,15 +3,15 @@ --- // Math operators are left-associative. -#[test 10 / 2 / 2 == (10 / 2) / 2, true] -#[test 10 / 2 / 2 == 10 / (2 / 2), false] -#[test 1 / 2 * 3, 1.5] +#test(10 / 2 / 2 == (10 / 2) / 2, true) +#test(10 / 2 / 2 == 10 / (2 / 2), false) +#test(1 / 2 * 3, 1.5) --- // Assignment is right-associative. { - #let x = 1 - #let y = 2 + let x = 1 + let y = 2 x = y = "ok" test(x, none) test(y, "ok") diff --git a/tests/lang/typ/expr-binary.typ b/tests/lang/typ/expr-binary.typ index e84cb282d..9fbffe18d 100644 --- a/tests/lang/typ/expr-binary.typ +++ b/tests/lang/typ/expr-binary.typ @@ -10,30 +10,30 @@ // Test math operators. // Addition. -#[test 2 + 4, 6] -#[test "a" + "b", "ab"] -#[test (1, 2) + (3, 4), (1, 2, 3, 4)] -#[test (a: 1) + (b: 2, c: 3), (a: 1, b: 2, c: 3)] +#test(2 + 4, 6) +#test("a" + "b", "ab") +#test((1, 2) + (3, 4), (1, 2, 3, 4)) +#test((a: 1) + (b: 2, c: 3), (a: 1, b: 2, c: 3)) // Subtraction. -#[test 1-4, 3*-1] -#[test 4cm - 2cm, 2cm] -#[test 1e+2-1e-2, 99.99] +#test(1-4, 3*-1) +#test(4cm - 2cm, 2cm) +#test(1e+2-1e-2, 99.99) // Multiplication. -#[test 2 * 4, 8] +#test(2 * 4, 8) // Division. -#[test 12pt/.4, 30pt] -#[test 7 / 2, 3.5] +#test(12pt/.4, 30pt) +#test(7 / 2, 3.5) // Combination. -#[test 3-4 * 5 < -10, true] -#[test { #let x; x = 1 + 4*5 >= 21 and { x = "a"; x + "b" == "ab" }; x }, true] +#test(3-4 * 5 < -10, true) +#test({ let x; x = 1 + 4*5 >= 21 and { x = "a"; x + "b" == "ab" }; x }, true) // Mathematical identities. #let nums = (1, 3.14, 12pt, 45deg, 90%, 13% + 10pt) -#for v #in nums { +#for v in nums { // Test plus and minus. test(v + v - v, v) test(v - v - v, -v) @@ -43,12 +43,12 @@ test(v + v, 2 * v) // Integer addition does not give a float. - #if type(v) != "integer" { + if type(v) != "integer" { test(v + v, 2.0 * v) } // Linears cannot be divided by themselves. - #if type(v) != "linear" { + if type(v) != "linear" { test(v / v, 1.0) test(v / v == 1, true) } @@ -59,12 +59,12 @@ // - multiplied with integers and floats, // - divided by floats. #let dims = (10pt, 30%, 50% + 3cm) -#for a #in dims { - #for b #in dims { +#for a in dims { + for b in dims { test(type(a + b), type(a - b)) } - #for b #in (7, 3.14) { + for b in (7, 3.14) { test(type(a * b), type(a)) test(type(b * a), type(a)) test(type(a / b), type(a)) @@ -75,57 +75,57 @@ // Test boolean operators. // And. -#[test false and false, false] -#[test false and true, false] -#[test true and false, false] -#[test true and true, true] +#test(false and false, false) +#test(false and true, false) +#test(true and false, false) +#test(true and true, true) // Or. -#[test false or false, false] -#[test false or true, true] -#[test true or false, true] -#[test true or true, true] +#test(false or false, false) +#test(false or true, true) +#test(true or false, true) +#test(true or true, true) // Short-circuiting. -#[test false and dont-care, false] -#[test true or dont-care, true] +#test(false and dont-care, false) +#test(true or dont-care, true) --- // Test equality operators. -#[test 1 == "hi", false] -#[test 1 == 1.0, true] -#[test 30% == 30% + 0cm, true] -#[test 1in == 0% + 72pt, true] -#[test 30% == 30% + 1cm, false] -#[test "ab" == "a" + "b", true] -#[test () == (1,), false] -#[test (1, 2, 3) == (1, 2.0) + (3,), true] -#[test (:) == (a: 1), false] -#[test (a: 2 - 1.0, b: 2) == (b: 2, a: 1), true] -#[test [*Hi*] == [*Hi*], true] +#test(1 == "hi", false) +#test(1 == 1.0, true) +#test(30% == 30% + 0cm, true) +#test(1in == 0% + 72pt, true) +#test(30% == 30% + 1cm, false) +#test("ab" == "a" + "b", true) +#test(() == (1,), false) +#test((1, 2, 3) == (1, 2.0) + (3,), true) +#test((:) == (a: 1), false) +#test((a: 2 - 1.0, b: 2) == (b: 2, a: 1), true) +#test([*Hi*] == [*Hi*], true) -#[test "a" != "a", false] -#[test [*] != [_], true] +#test("a" != "a", false) +#test([*] != [_], true) --- // Test comparison operators. -#[test 13 * 3 < 14 * 4, true] -#[test 5 < 10, true] -#[test 5 > 5, false] -#[test 5 <= 5, true] -#[test 5 <= 4, false] -#[test 45deg < 1rad, true] +#test(13 * 3 < 14 * 4, true) +#test(5 < 10, true) +#test(5 > 5, false) +#test(5 <= 5, true) +#test(5 <= 4, false) +#test(45deg < 1rad, true) --- // Test assignment operators. #let x = 0 -{ x = 10 } #[test x, 10] -{ x -= 5 } #[test x, 5] -{ x += 1 } #[test x, 6] -{ x *= x } #[test x, 36] -{ x /= 2.0 } #[test x, 18.0] -{ x = "some" } #[test x, "some"] -{ x += "thing" } #[test x, "something"] +{ x = 10 } #test(x, 10) +{ x -= 5 } #test(x, 5) +{ x += 1 } #test(x, 6) +{ x *= x } #test(x, 36) +{ x /= 2.0 } #test(x, 18.0) +{ x = "some" } #test(x, "some") +{ x += "thing" } #test(x, "something") diff --git a/tests/lang/typ/expr-invalid.typ b/tests/lang/typ/expr-invalid.typ index 2d16034bb..329a26162 100644 --- a/tests/lang/typ/expr-invalid.typ +++ b/tests/lang/typ/expr-invalid.typ @@ -4,14 +4,14 @@ --- // Missing expressions. -// Error: 3-3 expected expression +// Error: 3 expected expression {-} -// Error: 11-11 expected expression -#[test {1+}, 1] +// Error: 10 expected expression +#test({1+}, 1) -// Error: 11-11 expected expression -#[test {2*}, 2] +// Error: 10 expected expression +#test({2*}, 2) --- // Mismatched types. @@ -36,7 +36,7 @@ {(1 + "2", 40% - 1, 2 * true, 3 / 12pt)} // Error: 15-23 cannot apply '+=' to integer and string -{ #let x = 1; x += "2" } +{ let x = 1; x += "2" } --- // Bad left-hand sides of assignment. diff --git a/tests/lang/typ/expr-prec.typ b/tests/lang/typ/expr-prec.typ index fea5f7949..738e8fdf9 100644 --- a/tests/lang/typ/expr-prec.typ +++ b/tests/lang/typ/expr-prec.typ @@ -3,14 +3,14 @@ --- // Multiplication binds stronger than addition. -#[test 1+2*-3, -5] +#test(1+2*-3, -5) // Subtraction binds stronger than comparison. -#[test 3 == 5 - 2, true] +#test(3 == 5 - 2, true) // Boolean operations bind stronger than '=='. -#[test "a" == "a" and 2 < 3, true] -#[test not "b" == "b", false] +#test("a" == "a" and 2 < 3, true) +#test(not "b" == "b", false) // Assignment binds stronger than boolean operations. // Error: 2-7 cannot assign to this expression @@ -18,11 +18,11 @@ --- // Parentheses override precedence. -#[test (1), 1] -#[test (1+2)*-3, -9] +#test((1), 1) +#test((1+2)*-3, -9) -// Error: 15-15 expected closing paren -#[test {(1 + 1}, 2] +// Error: 15 expected closing paren +#test({(1 + 1}, 2) --- // Precedence doesn't matter for chained unary operators. diff --git a/tests/lang/typ/expr-unary.typ b/tests/lang/typ/expr-unary.typ index a1d97a494..c4b1937d1 100644 --- a/tests/lang/typ/expr-unary.typ +++ b/tests/lang/typ/expr-unary.typ @@ -3,7 +3,7 @@ --- // Test plus and minus. -#for v #in (1, 3.14, 12pt, 45deg, 90%, 13% + 10pt) { +#for v in (1, 3.14, 12pt, 45deg, 90%, 13% + 10pt) { // Test plus. test(+v, v) @@ -15,9 +15,9 @@ test(-++ --v, -v) } -#[test -(4 + 2), 6-12] +#test(-(4 + 2), 6-12) --- // Test not. -#[test not true, false] -#[test not false, true] +#test(not true, false) +#test(not false, true) diff --git a/tests/lang/typ/for-invalid.typ b/tests/lang/typ/for-invalid.typ index ca83649ab..3866909ff 100644 --- a/tests/lang/typ/for-invalid.typ +++ b/tests/lang/typ/for-invalid.typ @@ -7,29 +7,26 @@ // Error: 7-7 expected keyword `#in` #for v -// Error: 11-11 expected expression -#for v #in +// Error: 10-10 expected expression +#for v in -// Error: 16-16 expected body -#for v #in iter +// Error: 15-15 expected body +#for v in iter --- -// Should output `v iter`. -// Error: 2:5-2:5 expected identifier -// Error: 2:3-2:6 unexpected keyword `#in` +// Should output `v in iter`. +// Error: 5 expected identifier #for -v #in iter {} +v in iter {} // Should output `A thing`. // Error: 7-10 expected identifier, found string A#for "v" thing. -// Should output `iter`. -// Error: 2:6-2:9 expected identifier, found string -// Error: 1:10-1:13 unexpected keyword `#in` -#for "v" #in iter {} +// Should output `in iter`. +// Error: 6-9 expected identifier, found string +#for "v" in iter {} -// Should output `+ b iter`. -// Error: 2:7-2:7 expected keyword `#in` -// Error: 1:12-1:15 unexpected keyword `#in` -#for a + b #in iter {} +// Should output `+ b in iter`. +// Error: 7 expected keyword `#in` +#for a + b in iter {} diff --git a/tests/lang/typ/for-loop.typ b/tests/lang/typ/for-loop.typ index 2af7ab04b..e38ed1902 100644 --- a/tests/lang/typ/for-loop.typ +++ b/tests/lang/typ/for-loop.typ @@ -4,28 +4,29 @@ --- // Array. -#for x #in () {} +#for x in () {} #let sum = 0 -#for x #in (1, 2, 3, 4, 5) { +#for x in (1, 2, 3, 4, 5) { sum += x } -#[test sum, 15] + +#test(sum, 15) --- // Dictionary. // Ref: true -(\ #for k, v #in (name: "Typst", age: 2) [ - #[h 0.5cm] {k}: {v}, \ +(\ #for k, v in (name: "Typst", age: 2) [ + #h(0.5cm) {k}: {v}, \ ]) --- // String. { - #let out = "" - #let first = true - #for c #in "abc" { - #if not first { + let out = "" + let first = true + for c in "abc" { + if not first { out += ", " } first = false @@ -36,16 +37,16 @@ --- // Uniterable expression. -// Error: 12-16 cannot loop over boolean -#for v #in true {} +// Error: 11-15 cannot loop over boolean +#for v in true {} // Make sure that we don't complain twice. -// Error: 12-19 cannot add integer and string -#for v #in 1 + "2" {} +// Error: 11-18 cannot add integer and string +#for v in 1 + "2" {} // Error: 14-17 cannot apply '-' to string #let error = -"" -#let result = #for v #in (1, 2, 3) { - #if v < 2 [Ok] #else {error} +#let result = for v in (1, 2, 3) { + if v < 2 [Ok] else {error} } -#[test result, error] +#test(result, error) diff --git a/tests/lang/typ/for-pattern.typ b/tests/lang/typ/for-pattern.typ index 87bf603fe..38253b33d 100644 --- a/tests/lang/typ/for-pattern.typ +++ b/tests/lang/typ/for-pattern.typ @@ -5,26 +5,26 @@ #let out = () // Values of array. -#for v #in (1, 2, 3) { +#for v in (1, 2, 3) { out += (v,) } // Values of dictionary. -#for v #in (a: 4, b: 5) { +#for v in (a: 4, b: 5) { out += (v,) } // Keys and values of dictionary. -#for k, v #in (a: 6, b: 7) { +#for k, v in (a: 6, b: 7) { out += (k,) out += (v,) } -#[test out, (1, 2, 3, 4, 5, "a", 6, "b", 7)] +#test(out, (1, 2, 3, 4, 5, "a", 6, "b", 7)) --- // Keys and values of array. // Error: 6-10 mismatched pattern -#for k, v #in (-1, -2, -3) { +#for k, v in (-1, -2, -3) { dont-care } diff --git a/tests/lang/typ/for-value.typ b/tests/lang/typ/for-value.typ index 1813787d2..3ab807160 100644 --- a/tests/lang/typ/for-value.typ +++ b/tests/lang/typ/for-value.typ @@ -3,18 +3,18 @@ --- // Template body yields template. // Should output `234`. -#for v #in (1, 2, 3, 4) [#if v >= 2 [{v}]] +#for v in (1, 2, 3, 4) [#if v >= 2 [{v}]] --- // Block body yields template. // Should output `[1st, 2nd, 3rd, 4th, 5th, 6th]`. { - "[" + #for v #in (1, 2, 3, 4, 5, 6) { - (#if v > 1 [, ] + "[" + for v in (1, 2, 3, 4, 5, 6) { + (if v > 1 [, ] + [{v}] - + #if v == 1 [st] - + #if v == 2 [nd] - + #if v == 3 [rd] - + #if v >= 4 [th]) + + if v == 1 [st] + + if v == 2 [nd] + + if v == 3 [rd] + + if v >= 4 [th]) } + "]" } diff --git a/tests/lang/typ/heading.typ b/tests/lang/typ/heading.typ index 9bff2e6e8..8497ec8f7 100644 --- a/tests/lang/typ/heading.typ +++ b/tests/lang/typ/heading.typ @@ -9,7 +9,7 @@ ======6 // Too many hashtags. -// Warning: 1:1-1:8 should not exceed depth 6 +// Warning: 1-8 should not exceed depth 6 =======7 --- @@ -21,7 +21,7 @@ } // Function call continues heading. -= #[box][ += #box[ A ] B @@ -35,7 +35,7 @@ B // Parsed as headings if at start of the context. /**/ = Ok {[== Ok]} -#[box][=== Ok] +#box[=== Ok] // Not at the start of the context. No = heading diff --git a/tests/lang/typ/if-branch.typ b/tests/lang/typ/if-branch.typ index 8399d6741..64523a637 100644 --- a/tests/lang/typ/if-branch.typ +++ b/tests/lang/typ/if-branch.typ @@ -30,7 +30,7 @@ #if false [ Bad. ] #else { - #let pt = "." + let pt = "." "Ok" + pt } diff --git a/tests/lang/typ/if-invalid.typ b/tests/lang/typ/if-invalid.typ index c7ead226c..166de1229 100644 --- a/tests/lang/typ/if-invalid.typ +++ b/tests/lang/typ/if-invalid.typ @@ -1,13 +1,13 @@ // Test invalid if syntax. --- -// Error: 4-4 expected expression +// Error: 4 expected expression #if -// Error: 5-5 expected expression -{#if} +// Error: 4 expected expression +{if} -// Error: 6-6 expected body +// Error: 6 expected body #if x // Error: 1-6 unexpected keyword `#else` @@ -15,14 +15,14 @@ --- // Should output `x`. -// Error: 4-4 expected expression +// Error: 4 expected expression #if x {} // Should output `something`. -// Error: 6-6 expected body +// Error: 6 expected body #if x something // Should output `A thing.` -// Error: 20-20 expected body +// Error: 20 expected body A#if false {} #else thing diff --git a/tests/lang/typ/if-value.typ b/tests/lang/typ/if-value.typ index f9e95ff6c..d7124255f 100644 --- a/tests/lang/typ/if-value.typ +++ b/tests/lang/typ/if-value.typ @@ -3,19 +3,19 @@ --- { - #let x = 1 - #let y = 2 - #let z + let x = 1 + let y = 2 + let z // Returns if branch. - z = #if x < y { "ok" } + z = if x < y { "ok" } test(z, "ok") // Returns else branch. - z = #if x > y { "bad" } #else { "ok" } + z = if x > y { "bad" } else { "ok" } test(z, "ok") // Missing else evaluates to none. - z = #if x > y { "bad" } + z = if x > y { "bad" } test(z, none) } diff --git a/tests/lang/typ/let-invalid.typ b/tests/lang/typ/let-invalid.typ index 3e32e2cf4..f29353edf 100644 --- a/tests/lang/typ/let-invalid.typ +++ b/tests/lang/typ/let-invalid.typ @@ -1,17 +1,17 @@ // Test invalid let binding syntax. --- -// Error: 5-5 expected identifier +// Error: 5 expected identifier #let // Error: 6-9 expected identifier, found string #let "v" // Should output `1`. -// Error: 7-7 expected semicolon or line break +// Error: 7 expected semicolon or line break #let v 1 -// Error: 9-9 expected expression +// Error: 9 expected expression #let v = --- diff --git a/tests/lang/typ/let-terminated.typ b/tests/lang/typ/let-terminated.typ index 6dda7bb21..623265e05 100644 --- a/tests/lang/typ/let-terminated.typ +++ b/tests/lang/typ/let-terminated.typ @@ -13,16 +13,16 @@ One Three // Terminated because expression ends. -// Error: 12-12 expected semicolon or line break +// Error: 12 expected semicolon or line break #let v4 = 4 Four // Terminated by semicolon even though we are in a paren group. -// Error: 2:19-2:19 expected expression -// Error: 1:19-1:19 expected closing paren +// Error: 2:19 expected expression +// Error: 1:19 expected closing paren #let v5 = (1, 2 + ; Five -#[test v1, 1] -#[test v2, 2] -#[test v3, 3] -#[test v4, 4] -#[test v5, (1, 2)] +#test(v1, 1) +#test(v2, 2) +#test(v3, 3) +#test(v4, 4) +#test(v5, (1, 2)) diff --git a/tests/lang/typ/let-value.typ b/tests/lang/typ/let-value.typ index 12e1ba78c..700d337d6 100644 --- a/tests/lang/typ/let-value.typ +++ b/tests/lang/typ/let-value.typ @@ -4,8 +4,8 @@ --- // Automatically initialized with none. #let x -#[test x, none] +#test(x, none) // Manually initialized with one. #let x = 1 -#[test x, 1] +#test(x, 1) diff --git a/tests/lang/typ/raw.typ b/tests/lang/typ/raw.typ index a783216ea..f5074c8ee 100644 --- a/tests/lang/typ/raw.typ +++ b/tests/lang/typ/raw.typ @@ -47,5 +47,5 @@ def hi(): --- // Unterminated. -// Error: 2:1-2:1 expected backtick(s) +// Error: 2:1 expected backtick(s) `endless diff --git a/tests/lang/typ/spacing.typ b/tests/lang/typ/spacing.typ index 54e49f2d7..d44cd84c8 100644 --- a/tests/lang/typ/spacing.typ +++ b/tests/lang/typ/spacing.typ @@ -3,11 +3,11 @@ --- // Spacing around let. -// Error: 6-6 expected identifier +// Error: 6 expected identifier A#let;B \ -A#let x = 1;B #[test x, 1] \ -A #let x = 2;B #[test x, 2] \ -A#let x = 3; B #[test x, 3] \ +A#let x = 1;B #test(x, 1) \ +A #let x = 2;B #test(x, 2) \ +A#let x = 3; B #test(x, 3) \ --- // Spacing around if-else. @@ -22,6 +22,6 @@ A#if true [B] #else [] C \ --- // Spacing around for loop. -A#for _ #in (none,) [B]C \ -A#for _ #in (none,) [B] C \ -A #for _ #in (none,) [B]C \ +A#for _ in (none,) [B]C \ +A#for _ in (none,) [B] C \ +A #for _ in (none,) [B]C \ diff --git a/tests/lang/typ/strong.typ b/tests/lang/typ/strong.typ index 63e6eb35b..b02a55a5c 100644 --- a/tests/lang/typ/strong.typ +++ b/tests/lang/typ/strong.typ @@ -8,7 +8,7 @@ Partly str*ength*ened. // Scoped to body. -#[box][*Scoped] to body. +#box[*Scoped] to body. // Unterminated is fine. *The End diff --git a/tests/library/typ/box.typ b/tests/library/typ/box.typ index 67abe3509..57763f12e 100644 --- a/tests/library/typ/box.typ +++ b/tests/library/typ/box.typ @@ -1,20 +1,20 @@ -#[page "a7", flip: true] +#page("a7", flip: true) // Box with fixed width, should have text height. -#[box width: 2cm, color: #9650D6][A] +#box(width: 2cm, color: #9650D6)[A] Sometimes there is no box. // Box with fixed height, should span line. -#[box height: 2cm, width: 100%, color: #734CED][B] +#box(height: 2cm, width: 100%, color: #734CED)[B] // Empty box with fixed width and height. -#[box width: 6cm, height: 12pt, color: #CB4CED] +#box(width: 6cm, height: 12pt, color: #CB4CED) // Not visiblem, but creates a gap between the boxes above and below. -#[box width: 2in, color: #ff0000] +#box(width: 2in, color: #ff0000) // These are in a row! -#[box width: 1in, height: 10pt, color: #D6CD67] -#[box width: 1in, height: 10pt, color: #EDD466] -#[box width: 1in, height: 10pt, color: #E3BE62] +#box(width: 1in, height: 10pt, color: #D6CD67) +#box(width: 1in, height: 10pt, color: #EDD466) +#box(width: 1in, height: 10pt, color: #E3BE62) diff --git a/tests/library/typ/font.typ b/tests/library/typ/font.typ index 1bfc1fa65..7f13e8a67 100644 --- a/tests/library/typ/font.typ +++ b/tests/library/typ/font.typ @@ -1,37 +1,37 @@ // Test configuring font properties. -#[font "PT Sans", 10pt] +#font("PT Sans", 10pt) // Set same font size in three different ways. -#[font 20pt][A] -#[font 200%][A] -#[font 15pt + 50%][A] +#font(20pt)[A] +#font(200%)[A] +#font(15pt + 50%)[A] // Do nothing. -#[font][Normal] +#font[Normal] // Set style (is available). -#[font style: italic][Italic] +#font(style: italic)[Italic] // Set weight (is available). -#[font weight: bold][Bold] +#font(weight: bold)[Bold] // Set stretch (not available, matching closest). -#[font stretch: ultra-condensed][Condensed] +#font(stretch: ultra-condensed)[Condensed] -// Error: 8-13 unexpected argument -#[font false] +// Error: 7-12 unexpected argument +#font(false) -// Error: 3:15-3:19 expected font style, found font weight -// Error: 2:29-2:35 expected font weight, found string -// Error: 1:44-1:45 expected font family or array of font families, found integer -#[font style: bold, weight: "thin", serif: 0] +// Error: 3:14-3:18 expected font style, found font weight +// Error: 2:28-2:34 expected font weight, found string +// Error: 1:43-1:44 expected font family or array of font families, found integer +#font(style: bold, weight: "thin", serif: 0) -// Warning: 16-20 should be between 100 and 900 -#[font weight: 2700] +// Warning: 15-19 should be between 100 and 900 +#font(weight: 2700) -// Error: 8-28 unexpected argument -#[font something: "invalid"] +// Error: 7-27 unexpected argument +#font(something: "invalid") --- // Test font fallback and class definitions. @@ -40,17 +40,17 @@ Emoji: 🏀 // CMU Serif + Noto Emoji. -#[font "CMU Serif", "Noto Emoji"][ +#font("CMU Serif", "Noto Emoji")[ Emoji: 🏀 ] // Class definitions. -#[font serif: ("CMU Serif", "Latin Modern Math", "Noto Emoji")] -#[font serif][ +#font(serif: ("CMU Serif", "Latin Modern Math", "Noto Emoji")) +#font(serif)[ Math: ∫ α + β ➗ 3 ] // Class definition reused. -#[font sans-serif: "Noto Emoji"] -#[font sans-serif: ("Archivo", sans-serif)] +#font(sans-serif: "Noto Emoji") +#font(sans-serif: ("Archivo", sans-serif)) New sans-serif. 🚀 diff --git a/tests/library/typ/hv.typ b/tests/library/typ/hv.typ index 15799c811..154445cfc 100644 --- a/tests/library/typ/hv.typ +++ b/tests/library/typ/hv.typ @@ -1,22 +1,22 @@ // Ends paragraphs. -Tightly #[v -5pt] packed +Tightly #v(-5pt) packed // Eating up soft spacing. -Inv #[h 0pt] isible +Inv #h(0pt) isible // Multiple spacings in a row. -Add #[h 10pt] #[h 10pt] up +Add #h(10pt) #h(10pt) up // Relative to font size. -Relative #[h 100%] spacing +Relative #h(100%) spacing // Missing spacing. -// Error: 12-12 missing argument: spacing -Totally #[h] ignored +// Error: 12 missing argument: spacing +Totally #h() ignored // Swapped axes. -#[page main-dir: rtl, cross-dir: ttb, height: 80pt][ - 1 #[h 1cm] 2 +#page(main-dir: rtl, cross-dir: ttb, height: 80pt)[ + 1 #h(1cm) 2 - 3 #[v 1cm] 4 #[v -1cm] 5 + 3 #v(1cm) 4 #v(-1cm) 5 ] diff --git a/tests/library/typ/image.typ b/tests/library/typ/image.typ index ced364b36..8bf972b25 100644 --- a/tests/library/typ/image.typ +++ b/tests/library/typ/image.typ @@ -1,39 +1,35 @@ // Test loading different image formats. // Load an RGBA PNG image. -#[image "res/rhino.png"] -#[pagebreak] +#image("res/rhino.png") +#pagebreak() // Load an RGB JPEG image. -#[image "res/tiger.jpg"] +#image("res/tiger.jpg") // Error: 9-30 failed to load image -#[image "path/does/not/exist"] +#image("path/does/not/exist") // Error: 9-30 failed to load image -#[image "typ/image-error.typ"] +#image("typ/image-error.typ") --- // Test configuring the size and fitting behaviour of images. // Fit to width of page. -#[image "res/rhino.png"] +#image("res/rhino.png") // Fit to height of page. -#[page height: 40pt][ - #[image "res/rhino.png"] -] +#page(height: 40pt, image("res/rhino.png")) // Set width explicitly. -#[image "res/rhino.png", width: 50pt] +#image("res/rhino.png", width: 50pt) // Set height explicitly. -#[image "res/rhino.png", height: 50pt] +#image("res/rhino.png", height: 50pt) // Set width and height explicitly and force stretching. -#[image "res/rhino.png", width: 25pt, height: 50pt] +#image("res/rhino.png", width: 25pt, height: 50pt) // Make sure the bounding-box of the image is correct. -#[align bottom, right][ - #[image "res/tiger.jpg", width: 60pt] -] +#align(bottom, right, image("res/tiger.jpg", width: 60pt)) diff --git a/tests/library/typ/page.typ b/tests/library/typ/page.typ index 8a9604ad5..b7ac03484 100644 --- a/tests/library/typ/page.typ +++ b/tests/library/typ/page.typ @@ -1,53 +1,53 @@ // Test configuring page sizes and margins. // Set width and height. -#[page width: 120pt, height: 120pt] -#[page width: 40pt][High] -#[page height: 40pt][Wide] +#page(width: 120pt, height: 120pt) +#page(width: 40pt)[High] +#page(height: 40pt)[Wide] // Set all margins at once. -#[page margins: 30pt][ - #[align top, left][TL] - #[align bottom, right][BR] +#page(margins: 30pt)[ + #align(top, left)[TL] + #align(bottom, right)[BR] ] // Set individual margins. -#[page height: 40pt] -#[page left: 0pt | align left][Left] -#[page right: 0pt | align right][Right] -#[page top: 0pt | align top][Top] -#[page bottom: 0pt | align bottom][Bottom] +#page(height: 40pt) +#page(left: 0pt, align(left)[Left]) +#page(right: 0pt, align(right)[Right]) +#page(top: 0pt, align(top)[Top]) +#page(bottom: 0pt, align(bottom)[Bottom]) // Ensure that specific margins override general margins. -#[page margins: 0pt, left: 20pt][Overriden] +#page(margins: 0pt, left: 20pt)[Overriden] -// Error: 8-19 unknown variable -#[page nonexistant] +// Error: 7-18 unknown variable +#page(nonexistant) -// Error: 18-21 aligned axis -#[page main-dir: ltr] +// Error: 17-20 aligned axis +#page(main-dir: ltr) // Flipped predefined paper. -#[page "a11", flip: true][Flipped A11] +#page("a11", flip: true)[Flipped A11] // Flipped custom page size. -#[page width: 40pt, height: 120pt] -#[page flip: true] +#page(width: 40pt, height: 120pt) +#page(flip: true) Wide // Test changing the layouting directions of pages. -#[page height: 50pt, main-dir: btt, cross-dir: rtl] +#page(height: 50pt, main-dir: btt, cross-dir: rtl) Right to left! --- // Test a combination of pages with bodies and normal content. -#[page height: 50pt] +#page(height: 50pt) -#[page][First] -#[page][Second] -#[pagebreak] +#page[First] +#page[Second] +#pagebreak() Fourth -#[page][] +#page[] Sixth -#[page][Seventh and last] +#page[Seventh and last] diff --git a/tests/library/typ/pagebreak.typ b/tests/library/typ/pagebreak.typ index 08dd9c7b7..dc3e5682d 100644 --- a/tests/library/typ/pagebreak.typ +++ b/tests/library/typ/pagebreak.typ @@ -1,3 +1,3 @@ First of two -#[pagebreak] -#[page height: 40pt] +#pagebreak() +#page(height: 40pt) diff --git a/tests/library/typ/rgb.typ b/tests/library/typ/rgb.typ index 06f7be52e..b962bbc06 100644 --- a/tests/library/typ/rgb.typ +++ b/tests/library/typ/rgb.typ @@ -1,17 +1,17 @@ // Check the output. -#[rgb 0.0, 0.3, 0.7] +#rgb(0.0, 0.3, 0.7) // Alpha channel. -#[rgb 1.0, 0.0, 0.0, 0.5] +#rgb(1.0, 0.0, 0.0, 0.5) -// Warning: 2:7-2:10 should be between 0.0 and 1.0 -// Warning: 1:12-1:16 should be between 0.0 and 1.0 -#[rgb -30, 15.5, 0.5] +// Warning: 2:6-2:9 should be between 0.0 and 1.0 +// Warning: 1:11-1:15 should be between 0.0 and 1.0 +#rgb(-30, 15.5, 0.5) -// Error: 7-11 missing argument: blue component -#[rgb 0, 1] +// Error: 6-10 missing argument: blue component +#rgb(0, 1) // Error: 3:6-3:6 missing argument: red component // Error: 2:6-2:6 missing argument: green component // Error: 1:6-1:6 missing argument: blue component -#[rgb] +#rgb() diff --git a/tests/typeset.rs b/tests/typeset.rs index 7f8646bee..ac4fe9b01 100644 --- a/tests/typeset.rs +++ b/tests/typeset.rs @@ -296,7 +296,9 @@ fn parse_metadata(src: &str, map: &LineMap) -> (Option, DiagSet) { }; let mut s = Scanner::new(rest); - let (start, _, end) = (pos(&mut s), s.eat_assert('-'), pos(&mut s)); + let start = pos(&mut s); + let end = if s.eat_if('-') { pos(&mut s) } else { start }; + diags.insert(Diag::new(start .. end, level, s.rest().trim())); }