From 75472fee1a2377f56551fc856cf7511bd55091f0 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 4 May 2022 22:14:51 +0200 Subject: Division for lengths --- tests/typ/code/ops-invalid.typ | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'tests/typ/code/ops-invalid.typ') diff --git a/tests/typ/code/ops-invalid.typ b/tests/typ/code/ops-invalid.typ index 4e7fdb04..3e9e5478 100644 --- a/tests/typ/code/ops-invalid.typ +++ b/tests/typ/code/ops-invalid.typ @@ -38,6 +38,26 @@ // Error: 03-10 cannot add integer and string {(1 + "2", 40% - 1)} +--- +// Error: 14-22 cannot add integer and string +{ let x = 1; x += "2" } + +--- +// Error: 3-12 cannot divide ratio by length +{ 10% / 5pt } + +--- +// Error: 3-12 cannot divide these two lengths +{ 1em / 5pt } + +--- +// Error: 3-19 cannot divide relative length by ratio +{ (10% + 1pt) / 5% } + +--- +// Error: 3-28 cannot divide these two relative lengths +{ (10% + 1pt) / (20% + 1pt) } + --- // Error: 12-19 cannot subtract integer from ratio {(1234567, 40% - 1)} @@ -64,10 +84,6 @@ {x * "abcdefgh"} } ---- -// Error: 14-22 cannot add integer and string -{ let x = 1; x += "2" } - --- // Error: 3-6 cannot mutate a temporary value { (x) = "" } -- cgit v1.2.3