From 34f839c7177a041c187ae6103455cd875c4f3d22 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 3 Mar 2021 22:48:54 +0100 Subject: [PATCH] =?UTF-8?q?Improve=20tests=20=F0=9F=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/ref/library/rgb.png | Bin 2079 -> 0 bytes tests/typ/expr/call.typ | 1 - tests/typ/expr/closure.typ | 4 +--- tests/typ/library/box.typ | 3 +++ tests/typ/library/font.typ | 3 +++ tests/typ/library/hv.typ | 3 +++ tests/typ/library/image.typ | 3 +++ tests/typ/library/page.typ | 3 +++ tests/typ/library/pagebreak.typ | 3 +++ tests/typ/library/rgb.typ | 32 +++++++++++++++++++------------- 10 files changed, 38 insertions(+), 17 deletions(-) delete mode 100644 tests/ref/library/rgb.png diff --git a/tests/ref/library/rgb.png b/tests/ref/library/rgb.png deleted file mode 100644 index 37aef599fd9f51359a3b3d246ffb98a996ddd850..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2079 zcma)7dsNa}7XE>jXo_i;+Jp)^`5+a>lxs=S+ zZkpQ5SCUUG(JRtusbda3NV`Ni<4sFvNK4Cx)~uO7o4fb7&N^$Ib-uOt_w98~X-IH@ zf!=OC000aKc>hoU0BLLXixABM^k@~A1Axvv!Qba(-t(ndW%adwV~%nHaAD~m+ltWI zt5pm7sjwEr*QC2vb)m17_QmBnOW$ygiz%eE3N^ z*ka;i^m~x$18_i`)nxcbH`E89<;iM)CJ(R-J4)8C**Lzjex}`v%8nwVfcq`$x75WD zvh)g^WltxTj_)3dAbYU-_1L$({3YYLkP8<>vd>$ao!R$mBKXLP7&4Wm8y6*KOFA1X zfn!1>n5}N$MMlA0fuD&m{pk(^#d z(oXC~g;orariHBILeY^bU0Vy3shM-Vix_{yz^L9CjN*cJgf|$ceM;ZT*DL@3-Ln(8 ztO^O{_m!Z-Elp{Ph~IL2Io88fUM6elrh3dQEN@E|OkxB3HQ_mq!b2Z% zz+|LMD_PY5`IZ{}ZgxVC$tDMVE@D}EP6a-dE@?TErCM$Xp2Wcu#g84|S=jccOtD4P z@ip_cPbRsLdb`0(lfL>j4WFYoADe(`86TI!|6Dr=)SEj?zE zzIN|{7C(R0leo7MsuRX)XAD?=wK3)~W-fOyiBL$2Qf^)ZcMUr|@u7fC3YE6AXEl6Q zC6sk&{XB&=eW+~f8RTTN>qgJLgWxa)ULjZ9uH5cn?#xn8#vAf`@6On#Ezz)O59CBs z-KtTM03mTuiLmL(es=xenDCc%e=!H=-AQR(6V*h}34;nvJ0pj)Z!DRE$zy{37K+IR zKJwho9%^1LyVtaFe~Fb=bq zIT?jPTp%`y{2~A;55mzFAMG59m8gNP(rw#TtI-BCy_IjO(&5u31uW~3)7v$ehvOsC;` znX#`=ue%=ICl$pdROVxFky6YqpjrP>%@tGOEAwH3Ms5oI#MR5GgPt}nQl-AK#r?5o zoWoU&(Q9Lg40C~-oO&skj=^bWJtggxTc)d&`UGu}Ps3e3PLW+j!rB(0D=S<%f9{yk zG^I)PgKKplc0>lTy(dI0jz#72I+{DmD)X7(;YtTwi1zpJkpu_g2tE3&H&jY9Bp6ST zr6V#`)c7{YHH}UYEus|mgFy5tw%W=LlBkoFn74nPE9qp+^blv~_V6FF1j19Ad$-Xz zMr>p9c8O{H`Tg_#w%(Me$4}9|2d>|tFn7~Py>AloN32`l#K)HRAzmDIo_1aF$(a9J z4YEia)0C2$LPWWofZcBMqfp9%#eVZQQQ0A3pB*y|(`&%12wHyZ;M| a879bSYo14e+~MW7pPzsW_HXkg7yTQvlbBrq diff --git a/tests/typ/expr/call.typ b/tests/typ/expr/call.typ index 358322d12..0e941124c 100644 --- a/tests/typ/expr/call.typ +++ b/tests/typ/expr/call.typ @@ -54,7 +54,6 @@ --- // Different forms of template arguments. -// Ref: true #let a = "a" diff --git a/tests/typ/expr/closure.typ b/tests/typ/expr/closure.typ index d05acaa44..86a6f6328 100644 --- a/tests/typ/expr/closure.typ +++ b/tests/typ/expr/closure.typ @@ -1,7 +1,7 @@ // Test closures. +// Ref: false --- -// Ref: false // Basic closure without captures. { @@ -45,8 +45,6 @@ } --- -// Ref: false - // Too few arguments. { let types(x, y) = "[" + type(x) + ", " + type(y) + "]" diff --git a/tests/typ/library/box.typ b/tests/typ/library/box.typ index eff0be3d8..10e2c93e9 100644 --- a/tests/typ/library/box.typ +++ b/tests/typ/library/box.typ @@ -1,3 +1,6 @@ +// Test the box function. + +--- #page("a7", flip: true) // Box with fixed width, should have text height. diff --git a/tests/typ/library/font.typ b/tests/typ/library/font.typ index 165bdc10d..157557fed 100644 --- a/tests/typ/library/font.typ +++ b/tests/typ/library/font.typ @@ -1,3 +1,6 @@ +// Test the font function. + +--- // Test configuring font properties. // Set same font size in three different ways. diff --git a/tests/typ/library/hv.typ b/tests/typ/library/hv.typ index 154445cfc..09132a60b 100644 --- a/tests/typ/library/hv.typ +++ b/tests/typ/library/hv.typ @@ -1,3 +1,6 @@ +// Test the h and v functions. + +--- // Ends paragraphs. Tightly #v(-5pt) packed diff --git a/tests/typ/library/image.typ b/tests/typ/library/image.typ index 9c3cd4fe2..d3e6c78da 100644 --- a/tests/typ/library/image.typ +++ b/tests/typ/library/image.typ @@ -1,3 +1,6 @@ +// Test the image function. + +--- // Test loading different image formats. // Load an RGBA PNG image. diff --git a/tests/typ/library/page.typ b/tests/typ/library/page.typ index b7ac03484..1f16f009d 100644 --- a/tests/typ/library/page.typ +++ b/tests/typ/library/page.typ @@ -1,3 +1,6 @@ +// Test the page function. + +--- // Test configuring page sizes and margins. // Set width and height. diff --git a/tests/typ/library/pagebreak.typ b/tests/typ/library/pagebreak.typ index dc3e5682d..22af95126 100644 --- a/tests/typ/library/pagebreak.typ +++ b/tests/typ/library/pagebreak.typ @@ -1,3 +1,6 @@ +// Test the pagebreak function. + +--- First of two #pagebreak() #page(height: 40pt) diff --git a/tests/typ/library/rgb.typ b/tests/typ/library/rgb.typ index b962bbc06..62a1627cf 100644 --- a/tests/typ/library/rgb.typ +++ b/tests/typ/library/rgb.typ @@ -1,17 +1,23 @@ -// Check the output. -#rgb(0.0, 0.3, 0.7) +// Test the rgb function. +// Ref: false -// Alpha channel. -#rgb(1.0, 0.0, 0.0, 0.5) +--- +{ + // Check the output. + test(rgb(0.0, 0.3, 0.7), #004db3) -// Warning: 2:6-2:9 should be between 0.0 and 1.0 -// Warning: 1:11-1:15 should be between 0.0 and 1.0 -#rgb(-30, 15.5, 0.5) + // Alpha channel. + test(rgb(1.0, 0.0, 0.0, 0.5), #ff000080) -// Error: 6-10 missing argument: blue component -#rgb(0, 1) + // Warning: 2:14-2:17 should be between 0.0 and 1.0 + // Warning: 1:19-1:23 should be between 0.0 and 1.0 + test(rgb(-30, 15.5, 0.5), #00ff80) -// Error: 3:6-3:6 missing argument: red component -// Error: 2:6-2:6 missing argument: green component -// Error: 1:6-1:6 missing argument: blue component -#rgb() + // Error: 14-18 missing argument: blue component + test(rgb(0, 1), #00ff00) + + // Error: 3:14-3:14 missing argument: red component + // Error: 2:14-2:14 missing argument: green component + // Error: 1:14-1:14 missing argument: blue component + test(rgb(), #000000) +}