From 57f5c0a1b15775f9500335f455c7dc7d70cea9f5 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 15 Dec 2021 11:12:38 +0100 Subject: Set Rules Episode V: The Tests Strike Back --- tests/typ/code/ops-invalid.typ | 2 +- tests/typ/code/ops.typ | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'tests/typ/code') 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. -- cgit v1.2.3