[latex3-commits] [git/LaTeX3-latex3-latex3] master: Tests for draw color and other state functions (6502a4b)

Joseph Wright joseph.wright at morningstar2.co.uk
Wed Feb 21 08:54:17 CET 2018


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/6502a4badd5523bdd0fd8c2fc22f68b61c4cbb02

>---------------------------------------------------------------

commit 6502a4badd5523bdd0fd8c2fc22f68b61c4cbb02
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Wed Feb 21 07:34:41 2018 +0000

    Tests for draw color and other state functions


>---------------------------------------------------------------

6502a4badd5523bdd0fd8c2fc22f68b61c4cbb02
 l3experimental/l3draw/build.lua               |    3 +
 l3experimental/l3draw/testfiles/m3draw004.lvt |   88 ++++++++++++++
 l3experimental/l3draw/testfiles/m3draw004.tlg |  157 +++++++++++++++++++++++++
 3 files changed, 248 insertions(+)

diff --git a/l3experimental/l3draw/build.lua b/l3experimental/l3draw/build.lua
index 4d33e81..62dabc6 100644
--- a/l3experimental/l3draw/build.lua
+++ b/l3experimental/l3draw/build.lua
@@ -12,6 +12,9 @@ maindir = "../.."
 
 typesetfiles = {"l3draw.dtx", "l3draw-code.tex"}
 
+-- Need color support
+checkdeps = {maindir .. "/l3kernel", maindir .. "/l3experimental/l3color"}
+
 -- Load the common build code
 dofile(maindir .. "/build-config.lua")
 
diff --git a/l3experimental/l3draw/testfiles/m3draw004.lvt b/l3experimental/l3draw/testfiles/m3draw004.lvt
new file mode 100644
index 0000000..e8f0add
--- /dev/null
+++ b/l3experimental/l3draw/testfiles/m3draw004.lvt
@@ -0,0 +1,88 @@
+%
+% Copyright (C) 2018 The LaTeX3 Project
+%
+
+\documentclass{minimal}
+\input{regression-test}
+
+\RequirePackage[check-declarations]{expl3}
+\ExplSyntaxOn
+\debug_on:n { deprecation }
+\ExplSyntaxOff
+
+\AUTHOR{Joseph Wright}
+\RequirePackage{l3draw}
+
+\ExplSyntaxOn
+
+\cs_set_protected:Npn \test:n #1
+  {
+    \hbox_set:Nn \l_tmpa_box
+      {
+        \draw_begin:
+        #1
+        \draw_path_rectangle:nn { 0 , 0 } { 1cm , 1cm }
+        \draw_path_use_clear:n { stroke }
+        \draw_end:
+      }
+    \box_show:N \l_tmpa_box
+  }
+
+\START
+
+\TEST { \l_draw_default_linewidth_dim }
+  {
+    \test:n { }
+    \dim_set:Nn \l_draw_default_linewidth_dim { 1pt }
+    \test:n { }
+  }
+
+\TEST { \draw_linewidth:n }
+  {
+    \test:n { \draw_linewidth:n { 1pt } }
+  }
+
+\TEST { \draw_color:n }
+  {
+    \test:n { \draw_color:n { red } }
+    \test:n
+      {
+        \draw_color:n { red }
+        \draw_path_rectangle:nn { 0 , 0 } { 1cm , 1cm }
+        \draw_path_use_clear:n { fill }
+        \draw_color:n { red }
+        \draw_path_rectangle:nn { 0 , 0 } { 1cm , 1cm }
+        \draw_path_use_clear:n { fillstroke }
+        \draw_color:n { red }
+      }
+  }
+
+\TEST { \draw_color_fill:n }
+  {
+    \test:n
+      {
+        \draw_color_fill:n { red }
+        \draw_path_rectangle:nn { 0 , 0 } { 1cm , 1cm }
+        \draw_path_use_clear:n { fill }
+        \draw_color_fill:n { red }
+        \draw_path_rectangle:nn { 0 , 0 } { 1cm , 1cm }
+        \draw_path_use_clear:n { fillstroke }
+        \draw_color_fill:n { red }
+      }
+  }
+
+\TEST { \draw_color_stroke:n }
+  {
+    \test:n
+      {
+        \draw_color_stroke:n { red }
+        \draw_path_rectangle:nn { 0 , 0 } { 1cm , 1cm }
+        \draw_path_use_clear:n { fill }
+        \draw_color_stroke:n { red }
+        \draw_path_rectangle:nn { 0 , 0 } { 1cm , 1cm }
+        \draw_path_use_clear:n { fillstroke }
+        \draw_color_stroke:n { red }
+      }
+  }
+
+\END
diff --git a/l3experimental/l3draw/testfiles/m3draw004.tlg b/l3experimental/l3draw/testfiles/m3draw004.tlg
new file mode 100644
index 0000000..e120a31
--- /dev/null
+++ b/l3experimental/l3draw/testfiles/m3draw004.tlg
@@ -0,0 +1,157 @@
+This is a generated file for the LaTeX (2e + expl3) validation system.
+Don't change this file in any respect.
+============================================================
+TEST 1: \l_draw_default_linewidth_dim 
+============================================================
+> \box...=
+\hbox(28.85275+0.0)x28.85275
+.\hbox(28.85275+0.0)x28.85275
+..\glue 0.2
+..\vbox(0.0+0.0)x0.0, shifted -0.2
+...\pdfliteral{q}
+...\pdfliteral{0.3985 w}
+...\pdfliteral{0 0 28.34647 28.34647 re}
+...\pdfliteral{S}
+...\pdfliteral{Q}
+! OK.
+<argument> \l_tmpa_box 
+l. ...  }
+> \box...=
+\hbox(29.45276+0.0)x29.45276
+.\hbox(29.45276+0.0)x29.45276
+..\glue 0.5
+..\vbox(0.0+0.0)x0.0, shifted -0.5
+...\pdfliteral{q}
+...\pdfliteral{0.99626 w}
+...\pdfliteral{0 0 28.34647 28.34647 re}
+...\pdfliteral{S}
+...\pdfliteral{Q}
+! OK.
+<argument> \l_tmpa_box 
+l. ...  }
+============================================================
+============================================================
+TEST 2: \draw_linewidth:n 
+============================================================
+> \box...=
+\hbox(29.45276+0.0)x29.45276
+.\hbox(29.45276+0.0)x29.45276
+..\glue 0.5
+..\vbox(0.0+0.0)x0.0, shifted -0.5
+...\pdfliteral{q}
+...\pdfliteral{0.3985 w}
+...\pdfliteral{0.99626 w}
+...\pdfliteral{0 0 28.34647 28.34647 re}
+...\pdfliteral{S}
+...\pdfliteral{Q}
+! OK.
+<argument> \l_tmpa_box 
+l. ...  }
+============================================================
+============================================================
+TEST 3: \draw_color:n 
+============================================================
+> \box...=
+\hbox(28.85275+0.0)x28.85275
+.\hbox(28.85275+0.0)x28.85275
+..\glue 0.2
+..\vbox(0.0+0.0)x0.0, shifted -0.2
+...\pdfliteral{q}
+...\pdfliteral{0.3985 w}
+...\pdfliteral{1 0 0 rg 1 0 0 RG}
+...\pdfliteral{0 0 28.34647 28.34647 re}
+...\pdfliteral{S}
+...\pdfliteral{Q}
+! OK.
+<argument> \l_tmpa_box 
+l. ...  }
+! Undefined control sequence.
+<argument> \ERROR 
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+> \box...=
+\hbox(28.85275+0.0)x28.85275
+.\hbox(28.85275+0.0)x28.85275
+..\glue 0.2
+..\vbox(0.0+0.0)x0.0, shifted -0.2
+...\pdfliteral{q}
+...\pdfliteral{0.3985 w}
+...\pdfliteral{1 0 0 rg 1 0 0 RG}
+...\pdfliteral{0 0 28.34647 28.34647 re}
+...\pdfliteral{f}
+...\pdfliteral{1 0 0 rg 1 0 0 RG}
+...\pdfliteral{0 0 28.34647 28.34647 re}
+...\pdfliteral{1 0 0 rg 1 0 0 RG}
+...\pdfliteral{0 0 28.34647 28.34647 re}
+...\pdfliteral{S}
+...\pdfliteral{Q}
+! OK.
+<argument> \l_tmpa_box 
+l. ...  }
+============================================================
+============================================================
+TEST 4: \draw_color_fill:n 
+============================================================
+! Undefined control sequence.
+<argument> \ERROR 
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+> \box...=
+\hbox(28.85275+0.0)x28.85275
+.\hbox(28.85275+0.0)x28.85275
+..\glue 0.2
+..\vbox(0.0+0.0)x0.0, shifted -0.2
+...\pdfliteral{q}
+...\pdfliteral{0.3985 w}
+...\pdfliteral{1 0 0 rg}
+...\pdfliteral{0 0 28.34647 28.34647 re}
+...\pdfliteral{f}
+...\pdfliteral{1 0 0 rg}
+...\pdfliteral{0 0 28.34647 28.34647 re}
+...\pdfliteral{1 0 0 rg}
+...\pdfliteral{0 0 28.34647 28.34647 re}
+...\pdfliteral{S}
+...\pdfliteral{Q}
+! OK.
+<argument> \l_tmpa_box 
+l. ...  }
+============================================================
+============================================================
+TEST 5: \draw_color_stroke:n 
+============================================================
+! Undefined control sequence.
+<argument> \ERROR 
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+> \box...=
+\hbox(28.85275+0.0)x28.85275
+.\hbox(28.85275+0.0)x28.85275
+..\glue 0.2
+..\vbox(0.0+0.0)x0.0, shifted -0.2
+...\pdfliteral{q}
+...\pdfliteral{0.3985 w}
+...\pdfliteral{1 0 0 RG}
+...\pdfliteral{0 0 28.34647 28.34647 re}
+...\pdfliteral{f}
+...\pdfliteral{1 0 0 RG}
+...\pdfliteral{0 0 28.34647 28.34647 re}
+...\pdfliteral{1 0 0 RG}
+...\pdfliteral{0 0 28.34647 28.34647 re}
+...\pdfliteral{S}
+...\pdfliteral{Q}
+! OK.
+<argument> \l_tmpa_box 
+l. ...  }
+============================================================





More information about the latex3-commits mailing list