From 2bb0135d2ad45b2a7228dbb61a04a703b1942798 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 2 Feb 2023 22:22:16 +0100 Subject: Fix inconsistency between text and idents in math --- tests/ref/compiler/highlight.png | Bin 137139 -> 142118 bytes tests/ref/math/attach.png | Bin 9990 -> 11105 bytes tests/ref/math/frac.png | Bin 5030 -> 22213 bytes tests/typ/compiler/highlight.typ | 3 ++- tests/typ/math/attach.typ | 5 +++-- tests/typ/math/frac.typ | 15 +++++++++++---- 6 files changed, 16 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/ref/compiler/highlight.png b/tests/ref/compiler/highlight.png index 317a2128..dba5591e 100644 Binary files a/tests/ref/compiler/highlight.png and b/tests/ref/compiler/highlight.png differ diff --git a/tests/ref/math/attach.png b/tests/ref/math/attach.png index 27843eb4..9c92a93d 100644 Binary files a/tests/ref/math/attach.png and b/tests/ref/math/attach.png differ diff --git a/tests/ref/math/frac.png b/tests/ref/math/frac.png index a3a9a3ae..d0ac9c1a 100644 Binary files a/tests/ref/math/frac.png and b/tests/ref/math/frac.png differ diff --git a/tests/typ/compiler/highlight.typ b/tests/typ/compiler/highlight.typ index 6c6ec802..2dc2474a 100644 --- a/tests/typ/compiler/highlight.typ +++ b/tests/typ/compiler/highlight.typ @@ -5,7 +5,7 @@ #set hello() #set hello.world() #set hello.my.world() - +#let foo(x) = x * 2 #show heading: func #show module.func: func #show module.func: it => {} @@ -30,6 +30,7 @@ $ hello.my.world $ $ hello.my.world() $ $ hello.my().world $ $ hello.my().world() $ +$ f_zeta(x), f_zeta(x)/1 $ $ emph(hello) $ $ emph(hello()) $ diff --git a/tests/typ/math/attach.typ b/tests/typ/math/attach.typ index cf3e9521..89ecfc48 100644 --- a/tests/typ/math/attach.typ +++ b/tests/typ/math/attach.typ @@ -6,8 +6,9 @@ $f_x + t^b + V_1^2 + attach(A, top: alpha, bottom: beta)$ --- -// Test text vs ident parsing. -$pi_1(Y), a_f(x) != a_zeta(x)$ +// Test function call after subscript. +$pi_1(Y), a_f(x), a^zeta(x) \ + a^subset.eq(x), a_(zeta(x)), pi_(1(Y))$ --- // Test associativity and scaling. diff --git a/tests/typ/math/frac.typ b/tests/typ/math/frac.typ index 27c2ae45..db37e28c 100644 --- a/tests/typ/math/frac.typ +++ b/tests/typ/math/frac.typ @@ -8,10 +8,6 @@ $ x = 1/2 = a/(a h) = a/a = a/(1/2) $ // Test parenthesis removal. $ (|x| + |y|)/2 < [1+2]/3 $ ---- -// Test associativity. -$ 1/2/3 = (1/2)/3 = 1/(2/3) $ - --- // Test large fraction. $ x = (-b plus.minus sqrt(b^2 - 4a c))/(2a) $ @@ -23,3 +19,14 @@ $ binom(circle, square) $ --- // Error: 8-13 missing argument: lower index $ binom(x^2) $ + +--- +// Test associativity. +$ 1/2/3 = (1/2)/3 = 1/(2/3) $ + +--- +// Test precedence. +$ a_1/b_2, 1/f(x), zeta(x)/2, "foo"[|x|]/2 \ + 🏳️‍🌈[x]/2, f [x]/2, phi [x]/2, 🏳️‍🌈 [x]/2 \ + +[x]/2, 1(x)/2, 2[x]/2 \ + (a)b/2, b(a)[b]/2 $ -- cgit v1.2.3