diff options
| author | Leedehai <18319900+Leedehai@users.noreply.github.com> | 2023-04-19 07:26:55 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-19 13:26:55 +0200 |
| commit | dc3017955a67e5509f6bc33cb9b4833806da4c22 (patch) | |
| tree | 364304f23268107cb0443fc0037a86bd4136d9ef /tests | |
| parent | e4b09d417e9bfc2c0011299272f33c6861e96a6f (diff) | |
Give more specific error messages (#881)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/typ/compiler/array.typ | 2 | ||||
| -rw-r--r-- | tests/typ/compiler/block.typ | 10 | ||||
| -rw-r--r-- | tests/typ/compiler/call.typ | 2 | ||||
| -rw-r--r-- | tests/typ/compiler/closure.typ | 14 | ||||
| -rw-r--r-- | tests/typ/compiler/dict.typ | 4 | ||||
| -rw-r--r-- | tests/typ/compiler/include.typ | 2 | ||||
| -rw-r--r-- | tests/typ/compiler/methods.typ | 2 | ||||
| -rw-r--r-- | tests/typ/compiler/ops-invalid.typ | 8 | ||||
| -rw-r--r-- | tests/typ/compiler/ops.typ | 6 | ||||
| -rw-r--r-- | tests/typ/compiler/recursion.typ | 2 | ||||
| -rw-r--r-- | tests/typ/text/escape.typ | 2 | ||||
| -rw-r--r-- | tests/typ/text/font.typ | 2 | ||||
| -rw-r--r-- | tests/typ/visualize/shape-circle.typ | 2 | ||||
| -rw-r--r-- | tests/typ/visualize/shape-square.typ | 2 |
14 files changed, 30 insertions, 30 deletions
diff --git a/tests/typ/compiler/array.typ b/tests/typ/compiler/array.typ index 97b5da52..c9e85ed7 100644 --- a/tests/typ/compiler/array.typ +++ b/tests/typ/compiler/array.typ @@ -224,7 +224,7 @@ // Error: 4-6 unexpected end of block comment #(1*/2) -// Error: 6-8 invalid number suffix +// Error: 6-8 invalid number suffix: u #(1, 1u 2) // Error: 3-4 unexpected comma diff --git a/tests/typ/compiler/block.typ b/tests/typ/compiler/block.typ index bb23c0fe..81c719da 100644 --- a/tests/typ/compiler/block.typ +++ b/tests/typ/compiler/block.typ @@ -61,7 +61,7 @@ // Block directly in markup also creates a scope. #{ let x = 1 } -// Error: 7-8 unknown variable +// Error: 7-8 unknown variable: x #test(x, 1) --- @@ -73,7 +73,7 @@ #test(a, 1) -// Error: 3-4 unknown variable +// Error: 3-4 unknown variable: b #{b} --- @@ -83,7 +83,7 @@ test(b, 1) }} -// Error: 2-3 unknown variable +// Error: 2-3 unknown variable: b #b --- @@ -106,13 +106,13 @@ // Content blocks also create a scope. #[#let x = 1] -// Error: 2-3 unknown variable +// Error: 2-3 unknown variable: x #x --- // Multiple unseparated expressions in one line. -// Error: 2-4 invalid number suffix +// Error: 2-4 invalid number suffix: u #1u // Should output `1`. diff --git a/tests/typ/compiler/call.typ b/tests/typ/compiler/call.typ index f78dec20..04eb2906 100644 --- a/tests/typ/compiler/call.typ +++ b/tests/typ/compiler/call.typ @@ -44,7 +44,7 @@ } --- -// Error: 26-30 duplicate argument +// Error: 26-30 duplicate argument: font #set text(font: "Arial", font: "Helvetica") --- diff --git a/tests/typ/compiler/closure.typ b/tests/typ/compiler/closure.typ index a1e51d56..915de850 100644 --- a/tests/typ/compiler/closure.typ +++ b/tests/typ/compiler/closure.typ @@ -106,7 +106,7 @@ --- // Don't leak environment. #{ - // Error: 16-17 unknown variable + // Error: 16-17 unknown variable: x let func() = x let x = "hi" func() @@ -141,22 +141,22 @@ test(greet("Typst"), "Hey, Typst!") test(greet("Typst", birthday: true), "Happy Birthday, Typst!") - // Error: 23-35 unexpected argument + // Error: 23-35 unexpected argument: whatever test(greet("Typst", whatever: 10)) } --- -// Error: 11-12 duplicate parameter +// Error: 11-12 duplicate parameter: x #let f(x, x) = none --- -// Error: 14-15 duplicate parameter -// Error: 23-24 duplicate parameter -// Error: 35-36 duplicate parameter +// Error: 14-15 duplicate parameter: a +// Error: 23-24 duplicate parameter: b +// Error: 35-36 duplicate parameter: b #let f(a, b, a: none, b: none, c, b) = none --- -// Error: 13-14 duplicate parameter +// Error: 13-14 duplicate parameter: a #let f(a, ..a) = none --- diff --git a/tests/typ/compiler/dict.typ b/tests/typ/compiler/dict.typ index fb0a59a3..6c982ed4 100644 --- a/tests/typ/compiler/dict.typ +++ b/tests/typ/compiler/dict.typ @@ -56,11 +56,11 @@ #test(dict, (a: 3, b: 1)) --- -// Error: 24-29 duplicate key +// Error: 24-29 duplicate key: first #(first: 1, second: 2, first: 3) --- -// Error: 17-20 duplicate key +// Error: 17-20 duplicate key: a #(a: 1, "b": 2, "a": 3) --- diff --git a/tests/typ/compiler/include.typ b/tests/typ/compiler/include.typ index fa2e84c0..586e869b 100644 --- a/tests/typ/compiler/include.typ +++ b/tests/typ/compiler/include.typ @@ -24,7 +24,7 @@ #include "modules/chap1.typ" // The variables of the file should not appear in this scope. -// Error: 2-6 unknown variable +// Error: 2-6 unknown variable: name #name --- diff --git a/tests/typ/compiler/methods.typ b/tests/typ/compiler/methods.typ index 86faefbc..afcb024f 100644 --- a/tests/typ/compiler/methods.typ +++ b/tests/typ/compiler/methods.typ @@ -42,5 +42,5 @@ #(numbers.sorted() = 1) --- -// Error: 2-5 cannot mutate a constant +// Error: 2-5 cannot mutate a constant: box #box.push(1) diff --git a/tests/typ/compiler/ops-invalid.typ b/tests/typ/compiler/ops-invalid.typ index 8ccbb8b7..3ab62929 100644 --- a/tests/typ/compiler/ops-invalid.typ +++ b/tests/typ/compiler/ops-invalid.typ @@ -97,7 +97,7 @@ } --- -// Error: 4-5 unknown variable +// Error: 4-5 unknown variable: x #((x) = "") --- @@ -110,15 +110,15 @@ #(not x = "a") --- -// Error: 7-8 unknown variable +// Error: 7-8 unknown variable: x #(1 + x += 3) --- -// Error: 3-4 unknown variable +// Error: 3-4 unknown variable: z #(z = 1) --- -// Error: 3-7 cannot mutate a constant +// Error: 3-7 cannot mutate a constant: rect #(rect = "hi") --- diff --git a/tests/typ/compiler/ops.typ b/tests/typ/compiler/ops.typ index 1a9a2169..a6c64cbd 100644 --- a/tests/typ/compiler/ops.typ +++ b/tests/typ/compiler/ops.typ @@ -116,11 +116,11 @@ #test(0xA + 0xa, 0x14) --- -// Error: 2-7 invalid binary number +// Error: 2-7 invalid binary number: 0b123 #0b123 --- -// Error: 2-8 invalid hexadecimal number +// Error: 2-8 invalid hexadecimal number: 0x123z #0x123z --- @@ -201,7 +201,7 @@ #(x += "thing") #test(x, "something") --- -// Error: 3-6 cannot mutate a constant +// Error: 3-6 cannot mutate a constant: box #(box = 1) --- diff --git a/tests/typ/compiler/recursion.typ b/tests/typ/compiler/recursion.typ index ae214631..1bd53178 100644 --- a/tests/typ/compiler/recursion.typ +++ b/tests/typ/compiler/recursion.typ @@ -15,7 +15,7 @@ --- // Test with unnamed function. -// Error: 17-18 unknown variable +// Error: 17-18 unknown variable: f #let f = (n) => f(n - 1) #f(10) diff --git a/tests/typ/text/escape.typ b/tests/typ/text/escape.typ index 95a8a027..e7ec9023 100644 --- a/tests/typ/text/escape.typ +++ b/tests/typ/text/escape.typ @@ -27,7 +27,7 @@ let f() , ; : | + - /= == 12 "string" --- // Unicode codepoint does not exist. -// Error: 1-11 invalid unicode escape sequence +// Error: 1-11 invalid unicode codepoint: FFFFFF \u{FFFFFF} --- diff --git a/tests/typ/text/font.typ b/tests/typ/text/font.typ index 9844d066..07d00d14 100644 --- a/tests/typ/text/font.typ +++ b/tests/typ/text/font.typ @@ -56,5 +56,5 @@ Emoji: 🐪, 🌋, 🏞 #set text(size: 10pt, 12pt) --- -// Error: 11-31 unexpected argument +// Error: 11-31 unexpected argument: something #set text(something: "invalid") diff --git a/tests/typ/visualize/shape-circle.typ b/tests/typ/visualize/shape-circle.typ index cde4b112..34238d9a 100644 --- a/tests/typ/visualize/shape-circle.typ +++ b/tests/typ/visualize/shape-circle.typ @@ -54,5 +54,5 @@ Expanded by height. --- // Radius wins over width and height. -// Error: 23-34 unexpected argument +// Error: 23-34 unexpected argument: width #circle(radius: 10pt, width: 50pt, height: 100pt, fill: eastern) diff --git a/tests/typ/visualize/shape-square.typ b/tests/typ/visualize/shape-square.typ index cb6552e4..a321dc4a 100644 --- a/tests/typ/visualize/shape-square.typ +++ b/tests/typ/visualize/shape-square.typ @@ -35,5 +35,5 @@ --- // Size wins over width and height. -// Error: 09-20 unexpected argument +// Error: 09-20 unexpected argument: width #square(width: 10cm, height: 20cm, size: 1cm, fill: rgb("eb5278")) |
