diff --git a/tests/Cargo.toml b/tests/Cargo.toml index 960583eb7..9ad8ee7ca 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -10,7 +10,7 @@ publish = false typst = { path = "../crates/typst" } typst-library = { path = "../crates/typst-library" } comemo = "0.3" -ecow = { version = "0.1.1", features = ["serde"] } +ecow = { version = "0.1.2", features = ["serde"] } iai = { git = "https://github.com/reknih/iai" } once_cell = "1" oxipng = { version = "8.0.0", default-features = false, features = ["filetime", "parallel", "zopfli"] } diff --git a/tests/ref/bugs/grid-2.png b/tests/ref/bugs/grid-2.png index 571604134..882e0d6ad 100644 Binary files a/tests/ref/bugs/grid-2.png and b/tests/ref/bugs/grid-2.png differ diff --git a/tests/ref/compiler/call.png b/tests/ref/compiler/call.png index 82e1bb55a..2c5d1e78f 100644 Binary files a/tests/ref/compiler/call.png and b/tests/ref/compiler/call.png differ diff --git a/tests/ref/compiler/repr.png b/tests/ref/compiler/repr.png index e3bed1bef..994a6a922 100644 Binary files a/tests/ref/compiler/repr.png and b/tests/ref/compiler/repr.png differ diff --git a/tests/src/tests.rs b/tests/src/tests.rs index fee6f2b7b..b575b4d48 100644 --- a/tests/src/tests.rs +++ b/tests/src/tests.rs @@ -151,8 +151,6 @@ fn main() { } fn library() -> Library { - /// Display: Test - /// Category: test #[func] fn test(lhs: Value, rhs: Value) -> StrResult { if lhs != rhs { @@ -161,8 +159,6 @@ fn library() -> Library { Ok(NoneValue) } - /// Display: Print - /// Category: test #[func] fn print(#[variadic] values: Vec) -> NoneValue { let mut stdout = io::stdout().lock(); @@ -191,8 +187,8 @@ fn library() -> Library { lib.styles.set(TextElem::set_size(TextSize(Abs::pt(10.0).into()))); // Hook up helpers into the global scope. - lib.global.scope_mut().define("test", test_func()); - lib.global.scope_mut().define("print", print_func()); + lib.global.scope_mut().define_func::(); + lib.global.scope_mut().define_func::(); lib.global .scope_mut() .define("conifer", RgbaColor::new(0x9f, 0xEB, 0x52, 0xFF)); diff --git a/tests/typ/bugs/grid-2.typ b/tests/typ/bugs/grid-2.typ index 345ea6b1e..b7528b7bd 100644 --- a/tests/typ/bugs/grid-2.typ +++ b/tests/typ/bugs/grid-2.typ @@ -9,7 +9,7 @@ rect(width: 100%, fill: red), rect(width: 100%, fill: blue), rect(width: 100%, height: 80%, fill: green), - [hello \ darkness #parbreak my \ old \ friend \ I], + [hello \ darkness #parbreak() my \ old \ friend \ I], rect(width: 100%, height: 20%, fill: blue), polygon(fill: red, (0%, 0%), (100%, 0%), (100%, 20%)) ) diff --git a/tests/typ/compiler/array.typ b/tests/typ/compiler/array.typ index 58c108a41..92d926a07 100644 --- a/tests/typ/compiler/array.typ +++ b/tests/typ/compiler/array.typ @@ -71,7 +71,7 @@ --- // Test bad lvalue. -// Error: 2:3-2:15 type array has no method `yolo` +// Error: 2:9-2:13 type array has no method `yolo` #let array = (1, 2, 3) #(array.yolo() = 4) @@ -122,7 +122,7 @@ } --- -// Error: 2:16-2:18 missing argument: index +// Error: 2:2-2:18 missing argument: index #let numbers = () #numbers.insert() diff --git a/tests/typ/compiler/block.typ b/tests/typ/compiler/block.typ index 386994e9b..0580acd2a 100644 --- a/tests/typ/compiler/block.typ +++ b/tests/typ/compiler/block.typ @@ -46,7 +46,7 @@ #test({ type("") none -}, "string") +}, str) --- // Some things can't be joined. diff --git a/tests/typ/compiler/call.typ b/tests/typ/compiler/call.typ index 77e17b505..5297ec159 100644 --- a/tests/typ/compiler/call.typ +++ b/tests/typ/compiler/call.typ @@ -31,12 +31,12 @@ // Call function assigned to variable. #let alias = type -#test(alias(alias), "function") +#test(alias(alias), type) // Callee expressions. #{ // Wrapped in parens. - test((type)("hi"), "string") + test((type)("hi"), str) // Call the return value of a function. let adder(dx) = x => x + dx diff --git a/tests/typ/compiler/closure.typ b/tests/typ/compiler/closure.typ index 0f6809b5b..92d01446a 100644 --- a/tests/typ/compiler/closure.typ +++ b/tests/typ/compiler/closure.typ @@ -115,7 +115,7 @@ --- // Too few arguments. #{ - let types(x, y) = "[" + type(x) + ", " + type(y) + "]" + let types(x, y) = "[" + str(type(x)) + ", " + str(type(y)) + "]" test(types(14%, 12pt), "[ratio, length]") // Error: 13-21 missing argument: y diff --git a/tests/typ/compiler/comment.typ b/tests/typ/compiler/comment.typ index 4a4dc7ab0..fcab33525 100644 --- a/tests/typ/compiler/comment.typ +++ b/tests/typ/compiler/comment.typ @@ -12,7 +12,7 @@ C/* // Works in code. #test(type(/*1*/ 1) // -, "integer") +, int) // End of block comment in line comment. // Hello */ diff --git a/tests/typ/compiler/dict.typ b/tests/typ/compiler/dict.typ index 957ebe922..2668f347d 100644 --- a/tests/typ/compiler/dict.typ +++ b/tests/typ/compiler/dict.typ @@ -98,8 +98,8 @@ let dict = ( func: () => 1, ) - // Error: 3-14 type dictionary has no method `func` - // Hint: 3-14 to call the function stored in the dictionary, surround the field access with parentheses + // Error: 8-12 type dictionary has no method `func` + // Hint: 8-12 to call the function stored in the dictionary, surround the field access with parentheses dict.func() } @@ -109,6 +109,6 @@ nonfunc: 1 ) - // Error: 3-17 type dictionary has no method `nonfunc` + // Error: 8-15 type dictionary has no method `nonfunc` dict.nonfunc() -} \ No newline at end of file +} diff --git a/tests/typ/compiler/field.typ b/tests/typ/compiler/field.typ index a99959ea6..35768ec5a 100644 --- a/tests/typ/compiler/field.typ +++ b/tests/typ/compiler/field.typ @@ -47,7 +47,7 @@ #f.invalid --- -// Error: 6-13 dictionary does not contain key "invalid" and no default value was specified +// Error: 6-13 dictionary does not contain key "invalid" #(:).invalid --- @@ -55,7 +55,7 @@ #false.ok --- -// Error: 25-28 content does not contain field "fun" and no default value was specified +// Error: 25-28 content does not contain field "fun" #show heading: it => it.fun = A @@ -73,21 +73,21 @@ --- // Test length fields. -#test((1pt).em, 0em) +#test((1pt).em, 0.0) #test((1pt).abs, 1pt) -#test((3em).em, 3em) +#test((3em).em, 3.0) #test((3em).abs, 0pt) -#test((2em + 2pt).em, 2em) +#test((2em + 2pt).em, 2.0) #test((2em + 2pt).abs, 2pt) --- // Test stroke fields for simple strokes. #test((1em + blue).paint, blue) #test((1em + blue).thickness, 1em) -#test((1em + blue).cap, "butt") -#test((1em + blue).join, "miter") -#test((1em + blue).dash, none) -#test((1em + blue).miter-limit, 4.0) +#test((1em + blue).cap, auto) +#test((1em + blue).join, auto) +#test((1em + blue).dash, auto) +#test((1em + blue).miter-limit, auto) --- // Test complex stroke fields. @@ -102,7 +102,7 @@ #test(s1.cap, "round") #test(s1.join, "bevel") #test(s1.miter-limit, 5.0) -#test(s3.miter-limit, 4.0) +#test(s3.miter-limit, auto) #test(s1.dash, none) #test(s2.dash, (array: (3pt, "dot", 4em), phase: 0pt)) #test(s3.dash, (array: (3pt, "dot", 4em), phase: 5em)) diff --git a/tests/typ/compiler/for.typ b/tests/typ/compiler/for.typ index b2a2287d3..64b5a1d48 100644 --- a/tests/typ/compiler/for.typ +++ b/tests/typ/compiler/for.typ @@ -76,7 +76,7 @@ // Return value. #test(for v in "" [], none) -#test(type(for v in "1" []), "content") +#test(type(for v in "1" []), content) --- // Uniterable expression. diff --git a/tests/typ/compiler/if.typ b/tests/typ/compiler/if.typ index f278234bd..1d2ed88be 100644 --- a/tests/typ/compiler/if.typ +++ b/tests/typ/compiler/if.typ @@ -41,8 +41,8 @@ // Content block can be argument or body depending on whitespace. #{ - if "content" == type[b] [Fi] else [Nope] - if "content" == type [Nope] else [ve.] + if content == type[b] [Fi] else [Nope] + if content == type [Nope] else [ve.] } #let i = 3 diff --git a/tests/typ/compiler/import.typ b/tests/typ/compiler/import.typ index e5a7a8580..fb7a06b81 100644 --- a/tests/typ/compiler/import.typ +++ b/tests/typ/compiler/import.typ @@ -116,12 +116,10 @@ --- // Usual importing syntax also works for function scopes -#import enum #let d = (e: enum) #import d.e #import d.e as renamed #import d.e: item - #item(2)[a] --- @@ -166,11 +164,11 @@ #import () => {5}: x --- -// Error: 9-10 expected path, module or function, found integer +// Error: 9-10 expected path, module, function, or type, found integer #import 5: something --- -// Error: 9-10 expected path, module or function, found integer +// Error: 9-10 expected path, module, function, or type, found integer #import 5 as x --- @@ -213,14 +211,14 @@ This is never reached. --- // Renaming does not import the old name (without items). #import "module.typ" as something -// Error: 7-13 unknown variable: module -#test(module.b, 1) +// Error: 7-12 unknown variable: mymod +#test(mymod.b, 1) --- // Renaming does not import the old name (with items). #import "module.typ" as something: b as other -// Error: 7-13 unknown variable: module -#test(module.b, 1) +// Error: 7-12 unknown variable: mymod +#test(mymod.b, 1) --- // Error: 8 expected expression diff --git a/tests/typ/compiler/let.typ b/tests/typ/compiler/let.typ index 825f9e7b3..60f930d40 100644 --- a/tests/typ/compiler/let.typ +++ b/tests/typ/compiler/let.typ @@ -189,11 +189,11 @@ Three #let (a: "a", b: 2) = (a: 1, b: 2) --- -// Error: 10-11 destructuring key not found in dictionary +// Error: 10-11 dictionary does not contain key "b" #let (a, b) = (a: 1) --- -// Error: 10-11 destructuring key not found in dictionary +// Error: 10-11 dictionary does not contain key "b" #let (a, b: b) = (a: 1) --- diff --git a/tests/typ/compiler/methods.typ b/tests/typ/compiler/methods.typ index ace1dc606..e4c09ed25 100644 --- a/tests/typ/compiler/methods.typ +++ b/tests/typ/compiler/methods.typ @@ -31,7 +31,7 @@ #test(auto, [a].at("doesn't exist", default: auto)) --- -// Error: 2:2-2:15 type array has no method `fun` +// Error: 2:10-2:13 type array has no method `fun` #let numbers = () #numbers.fun() @@ -76,23 +76,23 @@ #test((5em + 6in).abs.inches(), 6.0) --- -// Error: 2-21 cannot convert a length with non-zero em units (-6pt + 10.5em) to pt -// Hint: 2-21 use 'length.abs.pt()' instead to ignore its em component +// Error: 2-21 cannot convert a length with non-zero em units (`-6pt + 10.5em`) to pt +// Hint: 2-21 use `length.abs.pt()` instead to ignore its em component #(10.5em - 6pt).pt() --- -// Error: 2-12 cannot convert a length with non-zero em units (3em) to cm -// Hint: 2-12 use 'length.abs.cm()' instead to ignore its em component +// Error: 2-12 cannot convert a length with non-zero em units (`3em`) to cm +// Hint: 2-12 use `length.abs.cm()` instead to ignore its em component #(3em).cm() --- -// Error: 2-20 cannot convert a length with non-zero em units (-226.77pt + 93em) to mm -// Hint: 2-20 use 'length.abs.mm()' instead to ignore its em component +// Error: 2-20 cannot convert a length with non-zero em units (`-226.77pt + 93em`) to mm +// Hint: 2-20 use `length.abs.mm()` instead to ignore its em component #(93em - 80mm).mm() --- -// Error: 2-24 cannot convert a length with non-zero em units (432pt + 4.5em) to inches -// Hint: 2-24 use 'length.abs.inches()' instead to ignore its em component +// Error: 2-24 cannot convert a length with non-zero em units (`432pt + 4.5em`) to inches +// Hint: 2-24 use `length.abs.inches()` instead to ignore its em component #(4.5em + 6in).inches() --- @@ -104,32 +104,32 @@ --- // Test color '.rgba()', '.cmyk()' and '.luma()' without conversions -#test(rgb(1, 2, 3, 4).rgba(), (1, 2, 3, 4)) -#test(rgb(1, 2, 3).rgba(), (1, 2, 3, 255)) -#test(cmyk(20%, 20%, 40%, 20%).cmyk(), (20%, 20%, 40%, 20%)) -#test(luma(40).luma(), 40) +#test(rgb(1, 2, 3, 4).to-rgba(), (1, 2, 3, 4)) +#test(rgb(1, 2, 3).to-rgba(), (1, 2, 3, 255)) +#test(cmyk(20%, 20%, 40%, 20%).to-cmyk(), (20%, 20%, 40%, 20%)) +#test(luma(40).to-luma(), 40) --- // Test color conversions. -#test(rgb(1, 2, 3).hex(), "#010203") -#test(rgb(1, 2, 3, 4).hex(), "#01020304") -#test(cmyk(4%, 5%, 6%, 7%).rgba(), (228, 225, 223, 255)) -#test(cmyk(4%, 5%, 6%, 7%).hex(), "#e4e1df") -#test(luma(40).rgba(), (40, 40, 40, 255)) -#test(luma(40).hex(), "#282828") -#test(repr(luma(40).cmyk()), repr((11.76%, 10.59%, 10.59%, 14.12%))) +#test(rgb(1, 2, 3).to-hex(), "#010203") +#test(rgb(1, 2, 3, 4).to-hex(), "#01020304") +#test(cmyk(4%, 5%, 6%, 7%).to-rgba(), (228, 225, 223, 255)) +#test(cmyk(4%, 5%, 6%, 7%).to-hex(), "#e4e1df") +#test(luma(40).to-rgba(), (40, 40, 40, 255)) +#test(luma(40).to-hex(), "#282828") +#test(repr(luma(40).to-cmyk()), repr((11.76%, 10.59%, 10.59%, 14.12%))) --- -// Error: 2-24 cannot obtain cmyk values from rgba color -#rgb(1, 2, 3, 4).cmyk() +// Error: 2-27 cannot obtain cmyk values from rgba color +#rgb(1, 2, 3, 4).to-cmyk() --- -// Error: 2-24 cannot obtain the luma value of rgba color -#rgb(1, 2, 3, 4).luma() +// Error: 2-27 cannot obtain the luma value of rgba color +#rgb(1, 2, 3, 4).to-luma() --- -// Error: 2-29 cannot obtain the luma value of cmyk color -#cmyk(4%, 5%, 6%, 7%).luma() +// Error: 2-32 cannot obtain the luma value of cmyk color +#cmyk(4%, 5%, 6%, 7%).to-luma() --- // Test alignment methods. diff --git a/tests/typ/compiler/ops-invalid.typ b/tests/typ/compiler/ops-invalid.typ index 0ed26a569..f3a83e7a1 100644 --- a/tests/typ/compiler/ops-invalid.typ +++ b/tests/typ/compiler/ops-invalid.typ @@ -87,7 +87,7 @@ #(3 / 12pt) --- -// Error: 3-10 cannot repeat this string -1 times +// Error: 3-10 number must be at least zero #(-1 * "") --- diff --git a/tests/typ/compiler/ops.typ b/tests/typ/compiler/ops.typ index 937e90244..56fdb7217 100644 --- a/tests/typ/compiler/ops.typ +++ b/tests/typ/compiler/ops.typ @@ -79,11 +79,11 @@ test(v + v, 2 * v) // Integer addition does not give a float. - if type(v) != "integer" { + if type(v) != int { test(v + v, 2.0 * v) } - if "relative" not in type(v) and ("pt" not in repr(v) or "em" not in repr(v)) { + if type(v) != relative and ("pt" not in repr(v) or "em" not in repr(v)) { test(v / v, 1.0) } } diff --git a/tests/typ/compiler/plugin.typ b/tests/typ/compiler/plugin.typ index aafbdaa1c..53d96f713 100644 --- a/tests/typ/compiler/plugin.typ +++ b/tests/typ/compiler/plugin.typ @@ -19,8 +19,9 @@ --- #let p = plugin("/files/hello.wasm") -// Error: 10-14 unexpected argument -#p.hello(true) +// Error: 10-14 expected bytes, found boolean +// Error: 27-29 expected bytes, found integer +#p.hello(true, bytes(()), 10) --- #let p = plugin("/files/hello.wasm") diff --git a/tests/typ/compiler/recursion.typ b/tests/typ/compiler/recursion.typ index 1bd53178f..82da72454 100644 --- a/tests/typ/compiler/recursion.typ +++ b/tests/typ/compiler/recursion.typ @@ -23,13 +23,13 @@ // Test capturing with named function. #let f = 10 #let f() = f -#test(type(f()), "function") +#test(type(f()), function) --- // Test capturing with unnamed function. #let f = 10 #let f = () => f -#test(type(f()), "integer") +#test(type(f()), int) --- // Error: 15-21 maximum function call depth exceeded diff --git a/tests/typ/compiler/repr.typ b/tests/typ/compiler/repr.typ index cfe428eb3..13593a868 100644 --- a/tests/typ/compiler/repr.typ +++ b/tests/typ/compiler/repr.typ @@ -37,9 +37,13 @@ // Content. #raw(lang: "typc", repr[*Hey*]) -// Functions are invisible. -Nothing +// Functions. #let f(x) = x -#f -#rect +#f \ +#rect \ #(() => none) + +// Types. +#int \ +#type("hi") \ +#type((a: 1)) diff --git a/tests/typ/compiler/show-node.typ b/tests/typ/compiler/show-node.typ index 27a4b6a9d..ff2bdb5a1 100644 --- a/tests/typ/compiler/show-node.typ +++ b/tests/typ/compiler/show-node.typ @@ -78,7 +78,7 @@ Another text. = Heading --- -// Error: 25-29 content does not contain field "page" and no default value was specified +// Error: 25-29 content does not contain field "page" #show heading: it => it.page = Heading @@ -96,7 +96,7 @@ Hey = Heading --- -// Error: 7-10 expected function, label, string, regular expression, symbol, or selector, found color +// Error: 7-10 expected symbol, string, label, function, regex, or selector, found color #show red: [] --- diff --git a/tests/typ/compiler/show-selector.typ b/tests/typ/compiler/show-selector.typ index 19f43feec..6bc08f7a8 100644 --- a/tests/typ/compiler/show-selector.typ +++ b/tests/typ/compiler/show-selector.typ @@ -40,4 +40,4 @@ the ```rs &mut T``` reference. --- // Error: 7-35 this selector cannot be used with show -#show selector(heading).or(strong): none +#show selector(heading).or(figure): none diff --git a/tests/typ/compiler/spread.typ b/tests/typ/compiler/spread.typ index 1bfef7b08..0afbed854 100644 --- a/tests/typ/compiler/spread.typ +++ b/tests/typ/compiler/spread.typ @@ -26,7 +26,7 @@ // Test doing things with arguments. #{ let save(..args) = { - test(type(args), "arguments") + test(type(args), arguments) test(repr(args), "(three: true, 1, 2)") } diff --git a/tests/typ/compiler/while.typ b/tests/typ/compiler/while.typ index 9eea2c37f..56409c6e2 100644 --- a/tests/typ/compiler/while.typ +++ b/tests/typ/compiler/while.typ @@ -26,7 +26,7 @@ #test(while false {}, none) #let i = 0 -#test(type(while i < 1 [#(i += 1)]), "content") +#test(type(while i < 1 [#(i += 1)]), content) --- // Condition must be boolean. diff --git a/tests/typ/compute/calc.typ b/tests/typ/compute/calc.typ index bdaf28a70..536c637af 100644 --- a/tests/typ/compute/calc.typ +++ b/tests/typ/compute/calc.typ @@ -11,7 +11,7 @@ #test(float(10), 10.0) #test(float(50% * 30%), 0.15) #test(float("31.4e-1"), 3.14) -#test(type(float(10)), "float") +#test(type(float(10)), float) --- #test(calc.round(calc.e, digits: 2), 2.72) @@ -22,7 +22,7 @@ #int(10pt) --- -// Error: 8-13 expected boolean, integer, ratio, string, or float, found function +// Error: 8-13 expected boolean, integer, ratio, string, or float, found type #float(float) --- diff --git a/tests/typ/compute/construct.typ b/tests/typ/compute/construct.typ index 80e0876a5..bef86fae4 100644 --- a/tests/typ/compute/construct.typ +++ b/tests/typ/compute/construct.typ @@ -62,7 +62,8 @@ --- // Error: 12-24 expected float or ratio, found string -#color.mix((red, "yes"), (green, "no")) +// Error: 26-39 expected float or ratio, found string +#color.mix((red, "yes"), (green, "no"), (green, 10%)) --- // Error: 12-23 expected a color or color-weight pair @@ -103,7 +104,7 @@ #test(str(10 / 3).len() > 10, true) --- -// Error: 6-8 expected integer, float, label, bytes, or string, found content +// Error: 6-8 expected integer, float, bytes, label, type, or string, found content #str([]) --- @@ -128,11 +129,11 @@ #str.to-unicode("ab") --- -// Error: 19-21 0xffffffffffffffff is not a valid codepoint -#str.from-unicode(-1) // negative values are not valid +// Error: 19-21 number must be at least zero +#str.from-unicode(-1) --- -// Error: 19-27 0x110000 is not a valid codepoint +// Error: 18-28 0x110000 is not a valid codepoint #str.from-unicode(0x110000) // 0x10ffff is the highest valid code point --- @@ -205,21 +206,21 @@ #datetime(year: 2000, month: 2, day: 30) --- -// Error: 26-35 missing closing bracket for bracket at index 0 +// Error: 27-34 missing closing bracket for bracket at index 0 #datetime.today().display("[year") --- -// Error: 26-39 invalid component name 'nothing' at index 1 +// Error: 27-38 invalid component name 'nothing' at index 1 #datetime.today().display("[nothing]") --- -// Error: 26-51 invalid modifier 'wrong' at index 6 +// Error: 27-50 invalid modifier 'wrong' at index 6 #datetime.today().display("[year wrong:last_two]") --- -// Error: 26-34 expected component name at index 2 +// Error: 27-33 expected component name at index 2 #datetime.today().display(" []") --- -// Error: 26-36 failed to format datetime (insufficient information) +// Error: 2-36 failed to format datetime (insufficient information) #datetime.today().display("[hour]") diff --git a/tests/typ/compute/foundations.typ b/tests/typ/compute/foundations.typ index 3da2e6019..4e74966fc 100644 --- a/tests/typ/compute/foundations.typ +++ b/tests/typ/compute/foundations.typ @@ -2,9 +2,9 @@ // Ref: false --- -#test(type(1), "integer") -#test(type(ltr), "direction") -#test(type(10 / 3), "float") +#test(type(1), int) +#test(type(ltr), direction) +#test(type(10 / 3), float) --- #test(repr(ltr), "ltr") @@ -68,9 +68,9 @@ --- // Test the `type` function. -#test(type(1), "integer") -#test(type(ltr), "direction") -#test(type(10 / 3), "float") +#test(type(1), int) +#test(type(ltr), direction) +#test(type(10 / 3), float) --- // Test the eval function. diff --git a/tests/typ/layout/align.typ b/tests/typ/layout/align.typ index 753683de2..98ee8da5c 100644 --- a/tests/typ/layout/align.typ +++ b/tests/typ/layout/align.typ @@ -35,9 +35,9 @@ --- // Ref: false -#test(type(center), "alignment") -#test(type(horizon), "alignment") -#test(type(center + horizon), "2d alignment") +#test(type(center), alignment) +#test(type(horizon), alignment) +#test(type(center + horizon), alignment) --- // Error: 8-22 cannot add two horizontal alignments @@ -46,3 +46,7 @@ --- // Error: 8-20 cannot add two vertical alignments #align(top + bottom, [A]) + +--- +// Error: 8-30 cannot add a vertical and a 2D alignment +#align(top + (bottom + right), [A]) diff --git a/tests/typ/layout/enum-align.typ b/tests/typ/layout/enum-align.typ index 9d11235c6..7cfa5505d 100644 --- a/tests/typ/layout/enum-align.typ +++ b/tests/typ/layout/enum-align.typ @@ -33,9 +33,12 @@ --- // Test valid number align values (horizontal) +// Ref: false #set enum(number-align: start) #set enum(number-align: end) #set enum(number-align: left) #set enum(number-align: right) -// Error: 25-28 alignment must be horizontal + +--- +// Error: 25-28 expected `start`, `left`, `center`, `right`, or `end`, found top #set enum(number-align: top) diff --git a/tests/typ/meta/bibliography.typ b/tests/typ/meta/bibliography.typ index 40d281fa2..07c17dc61 100644 --- a/tests/typ/meta/bibliography.typ +++ b/tests/typ/meta/bibliography.typ @@ -10,7 +10,7 @@ --- #set page(width: 200pt) = Details -See also #cite("arrgh", "distress", [p. 22]), @arrgh[p. 4], and @distress[p. 5]. +See also #cite("arrgh", "distress", supplement: [p. 22]), @arrgh[p. 4], and @distress[p. 5]. #bibliography("/files/works.bib") --- diff --git a/tests/typ/meta/outline-entry.typ b/tests/typ/meta/outline-entry.typ index 501474429..8f2901573 100644 --- a/tests/typ/meta/outline-entry.typ +++ b/tests/typ/meta/outline-entry.typ @@ -56,5 +56,5 @@ --- // Error: 2-23 cannot outline cite #outline(target: cite) -#cite("arrgh", "distress", [p. 22]) +#cite("arrgh", "distress", supplement: [p. 22]) #bibliography("/files/works.bib") diff --git a/tests/typ/text/raw-align.typ b/tests/typ/text/raw-align.typ index 2e124ea98..1dbaad169 100644 --- a/tests/typ/text/raw-align.typ +++ b/tests/typ/text/raw-align.typ @@ -33,5 +33,5 @@ b = 324923 #lorem(20) --- -// Error: 17-20 alignment must be horizontal +// Error: 17-20 expected `start`, `left`, `center`, `right`, or `end`, found top #set raw(align: top)