diff options
Diffstat (limited to 'tests/typ/code')
| -rw-r--r-- | tests/typ/code/call.typ | 11 | ||||
| -rw-r--r-- | tests/typ/code/include.typ | 2 | ||||
| -rw-r--r-- | tests/typ/code/ops-invalid.typ | 2 | ||||
| -rw-r--r-- | tests/typ/code/ops.typ | 10 | ||||
| -rw-r--r-- | tests/typ/code/spread.typ | 10 |
5 files changed, 19 insertions, 16 deletions
diff --git a/tests/typ/code/call.typ b/tests/typ/code/call.typ index 2c16af1c..5736c63b 100644 --- a/tests/typ/code/call.typ +++ b/tests/typ/code/call.typ @@ -5,7 +5,8 @@ // Ref: true // Ommitted space. -[#font(weight:"bold")Bold] +#let f() = {} +[#f()*Bold*] // Call return value of function with body. #let f(x, body) = (y) => [#x] + body + [#y] @@ -44,25 +45,25 @@ } --- -// Error: 2-6 expected function or collection, found boolean +// Error: 2-6 expected callable or collection, found boolean {true()} --- #let x = "x" -// Error: 1-3 expected function or collection, found string +// Error: 1-3 expected callable or collection, found string #x() --- #let f(x) = x -// Error: 1-6 expected function or collection, found integer +// Error: 1-6 expected callable or collection, found integer #f(1)(2) --- #let f(x) = x -// Error: 1-6 expected function or collection, found template +// Error: 1-6 expected callable or collection, found template #f[1](2) --- diff --git a/tests/typ/code/include.typ b/tests/typ/code/include.typ index 83e00384..1e5d5827 100644 --- a/tests/typ/code/include.typ +++ b/tests/typ/code/include.typ @@ -1,7 +1,7 @@ // Test include statements. --- -#page(width: 200pt) +#set page(width: 200pt) = Document diff --git a/tests/typ/code/ops-invalid.typ b/tests/typ/code/ops-invalid.typ index 91dd576f..340e4c9f 100644 --- a/tests/typ/code/ops-invalid.typ +++ b/tests/typ/code/ops-invalid.typ @@ -26,7 +26,7 @@ {not ()} --- -// Error: 2-18 cannot apply '<=' to linear and relative +// Error: 2-18 cannot apply '<=' to relative length and relative {30% + 1pt <= 40%} --- diff --git a/tests/typ/code/ops.typ b/tests/typ/code/ops.typ index 04a72e72..be2cdb48 100644 --- a/tests/typ/code/ops.typ +++ b/tests/typ/code/ops.typ @@ -64,7 +64,7 @@ } // Linears cannot be divided by themselves. - if type(v) != "linear" { + if type(v) != "relative length" { test(v / v, 1.0) test(v / v == 1, true) } @@ -130,12 +130,14 @@ #test(test == test, true) #test((() => {}) == (() => {}), false) -// Templates also compare by identity. +// Templates compare by shallow equality. #let t = [a] #test(t == t, true) -#test([] == [], false) +#test([] == [], true) +#test([a] == [a], true) #test([] == [a], false) -#test([a] == [a], false) +#test([[a]] == [a], false) +#test(box[] == box[], false) --- // Test comparison operators. diff --git a/tests/typ/code/spread.typ b/tests/typ/code/spread.typ index 41e790a4..5f7d2061 100644 --- a/tests/typ/code/spread.typ +++ b/tests/typ/code/spread.typ @@ -4,14 +4,14 @@ --- // Test standard argument overriding. { - let font(style: "normal", weight: "regular") = { + let f(style: "normal", weight: "regular") = { "(style: " + style + ", weight: " + weight + ")" } - let myfont(..args) = font(weight: "bold", ..args) - test(myfont(), "(style: normal, weight: bold)") - test(myfont(weight: "black"), "(style: normal, weight: black)") - test(myfont(style: "italic"), "(style: italic, weight: bold)") + let myf(..args) = f(weight: "bold", ..args) + test(myf(), "(style: normal, weight: bold)") + test(myf(weight: "black"), "(style: normal, weight: black)") + test(myf(style: "italic"), "(style: italic, weight: bold)") } --- |
