[latex3-commits] [git/LaTeX3-latex3-latex3] master: l3draw: First set of point function tests (993c523)

Joseph Wright joseph.wright at morningstar2.co.uk
Fri Feb 9 11:17:59 CET 2018


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/993c523ce75bd23efc6077605e7e8c41f2a7e3c7

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

commit 993c523ce75bd23efc6077605e7e8c41f2a7e3c7
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri Feb 9 09:18:50 2018 +0000

    l3draw: First set of point function tests


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

993c523ce75bd23efc6077605e7e8c41f2a7e3c7
 l3trial/l3draw/testfiles/m3draw001.lvt             |  142 ++++++++++++++++++++
 .../l3draw/testfiles/m3draw001.tlg                 |   87 ++++++------
 2 files changed, 191 insertions(+), 38 deletions(-)

diff --git a/l3trial/l3draw/testfiles/m3draw001.lvt b/l3trial/l3draw/testfiles/m3draw001.lvt
new file mode 100644
index 0000000..7ce05f1
--- /dev/null
+++ b/l3trial/l3draw/testfiles/m3draw001.lvt
@@ -0,0 +1,142 @@
+%
+% 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
+
+\START
+
+\TESTEXP { \draw_point_coord:nn }
+  {
+    \draw_point_coord:nn { 2pt + 3cm } { 3cm }
+    \NEWLINE
+    \draw_point_coord:nn { 10pt } { 1cm }
+    \NEWLINE
+    \draw_point_coord:nn { 10 } { 1 }
+    \NEWLINE
+    \draw_point_coord:nn { 10 * 3.5cm } { sqrt(2) }
+  }
+
+\TESTEXP { \draw_point_polar:nn }
+  {
+    \draw_point_polar:nn { 30 } { 1cm }
+    \NEWLINE
+    \draw_point_polar:nn { 30 } { 1cm ~ and ~ 2cm }
+    \NEWLINE
+    \draw_point_polar:nn { 15 + 15 } { 2 * 0.5cm ~ and ~ 2 * 1cm }
+    \NEWLINE
+  }
+
+\TESTEXP { \draw_point_add:nn }
+  {
+    \draw_point_add:nn
+      { \draw_point_vec_coord:nn { 0 } { 1 } }
+      { \draw_point_vec_coord:nn { 2 } { 3 } }
+    \NEWLINE
+    \draw_point_add:nn { { 1cm } { 1cm } } { { 2cm } { 2cm } }
+  }
+
+\TESTEXP { \draw_point_diff:nn }
+  {
+    \draw_point_diff:nn
+      { \draw_point_vec_coord:nn { 1 } { 1 } }
+      { \draw_point_vec_coord:nn { 2 } { 3 } }
+    \NEWLINE
+    \draw_point_diff:nn { { 1cm } { 1cm } } { { 2cm } { 2cm } }
+  }
+
+\TESTEXP { \draw_point_scale:nn }
+  {
+    \draw_point_scale:nn { 2 }
+      { \draw_point_vec_coord:nn { 0 } { 1 } }
+    \NEWLINE
+    \draw_point_scale:nn { 0.5 ^ 2 } { { 2cm } { 2cm } }
+  }
+
+\TESTEXP { \draw_point_intersect_lines:nnnn }
+  {
+    \draw_point_intersect_lines:nnnn
+      { \draw_point_vec_coord:nn { 0 } { 1 } }
+      { \draw_point_vec_coord:nn { 1 } { 0 } }
+      { \draw_point_vec_coord:nn { 2 } { 2 } }
+      { \draw_point_vec_coord:nn { 3 } { 4 } }
+    \NEWLINE
+    \draw_point_intersect_lines:nnnn
+      { \draw_point_vec_coord:nn { 0 } { 0 } }
+      { \draw_point_vec_coord:nn { 1 } { 1 } }
+      { \draw_point_vec_coord:nn { 0 } { 1 } }
+      { \draw_point_vec_coord:nn { sqrt(2) } { -sqrt(2) } }
+  }
+
+\TESTEXP { \draw_point_intersect_circles:nnnnn }
+  {
+    \draw_point_intersect_circles:nnnnn
+      { \draw_point_vec_coord:nn { 0 } { 1 } }
+      { 1cm }
+      { \draw_point_vec_coord:nn { 1 } { 0 } }
+      { 1cm }
+      { 1 }
+  }
+
+\TEST { \draw_set_<axis>vec:n }
+  {
+    \exp_args:Nx \tl_show:n { \draw_point_vec_coord:nnn { 1 } { 1 } { 1 } }
+    \draw_set_xvec:n { { 1cm } { 1cm } }
+    \exp_args:Nx \tl_show:n { \draw_point_vec_coord:nnn { 1 } { 1 } { 1 } }
+    \draw_set_yvec:n { { 1cm } { 1cm } }
+    \exp_args:Nx \tl_show:n { \draw_point_vec_coord:nnn { 1 } { 1 } { 1 } }
+    \draw_set_zvec:n { { 1cm } { 1cm } }
+    \exp_args:Nx \tl_show:n { \draw_point_vec_coord:nnn { 1 } { 1 } { 1 } }
+  }
+
+\OMIT
+  \draw_set_xvec:n { { 1cm } { 1cm } }
+  \draw_set_yvec:n { { 0cm } { 1cm } }
+\TIMO
+
+\TESTEXP { \draw_point_vec_coord:nn }
+  {
+    \draw_point_vec_coord:nn { 0 } { 0 }
+    \NEWLINE
+    \draw_point_vec_coord:nn { 1 } { 0 }
+    \NEWLINE
+    \draw_point_vec_coord:nn { 1 } { 1 }
+    \NEWLINE
+    \draw_point_vec_coord:nn { 1 } { 0 }
+  }
+
+\OMIT
+  \draw_set_xvec:n { { 1cm } { 0cm } }
+  \draw_set_yvec:n { { 0cm } { 1cm } }
+\TIMO
+
+\TESTEXP { \draw_point_vec_coord:nnn }
+  {
+    \draw_point_vec_coord:nnn { 0 } { 0 } { 0 }
+    \NEWLINE
+    \draw_point_vec_coord:nnn { 0 } { 0 } { 1 }
+    \NEWLINE
+    \draw_point_vec_coord:nnn { 0 } { 1 } { 0 }
+    \NEWLINE
+    \draw_point_vec_coord:nnn { 0 } { 1 } { 1 }
+  }
+
+\TESTEXP { \draw_point_vec_polar:nn }
+  {
+    \draw_point_vec_polar:nn { 30 } { 2 }
+    \NEWLINE
+    \draw_point_vec_polar:nn { 30 } { 1~and~2 }
+  }
+
+\END
diff --git a/l3kernel/testfiles/m3tl001.tlg b/l3trial/l3draw/testfiles/m3draw001.tlg
similarity index 56%
copy from l3kernel/testfiles/m3tl001.tlg
copy to l3trial/l3draw/testfiles/m3draw001.tlg
index b9a8e37..70e8170 100644
--- a/l3kernel/testfiles/m3tl001.tlg
+++ b/l3trial/l3draw/testfiles/m3draw001.tlg
@@ -1,73 +1,84 @@
 This is a generated file for the LaTeX (2e + expl3) validation system.
 Don't change this file in any respect.
-Author: Frank Mittelbach
 ============================================================
-TEST 1: allocate new variables
+TEST 1: \draw_point_coord:nn 
 ============================================================
-Defining \l_XX_tl on line ...
-Defining \l_YY_tl on line ...
-Defining \g_ZZ_tl on line ...
-Defining \g_AA_tl on line ...
-> \l_XX_tl=.
-> \l_YY_tl=.
-> \g_ZZ_tl=bar.
-> \g_AA_tl=##.
+{87.35826771653543pt}{85.35826771653543pt}
+{10pt}{28.45275590551181pt}
+{10pt}{1pt}
+{995.8464566929134pt}{1.414213562373095pt}
 ============================================================
-Defining \l_tmpc_tl on line ...
-Defining \l_tmpd_tl on line ...
 ============================================================
-TEST 2: use registers: expect " bar"
+TEST 2: \draw_point_polar:nn 
 ============================================================
- bar
+{24.64080942185094pt}{14.2263779527559pt}
+{24.64080942185094pt}{28.45275590551181pt}
+{24.64080942185094pt}{28.45275590551181pt}
 ============================================================
 ============================================================
-TEST 3: testing clear and put_left: expect ZZbar ZZbarfoo
+TEST 3: \draw_point_add:nn 
 ============================================================
-ZZbar ZZbarfoo
+{56.90548706054688pt}{113.8109741210938pt}
+{85.35826771653543pt}{85.35826771653543pt}
 ============================================================
 ============================================================
-TEST 4: clear or allocate variables
+TEST 4: \draw_point_diff:nn 
 ============================================================
-Defining \l_aa_tl on line ...
-> \l_XX_tl=.
-> \l_aa_tl=.
-> \g_ZZ_tl=.
+{28.45274353027344pt}{56.90548706054688pt}
+{28.45275590551181pt}{28.45275590551181pt}
 ============================================================
 ============================================================
-TEST 5: clear inside group: expect XX <empty>
+TEST 5: \draw_point_scale:nn 
 ============================================================
-> \l_XX_tl=XX.
-> \g_ZZ_tl=.
+{0pt}{56.90548706054688pt}
+{14.2263779527559pt}{14.2263779527559pt}
 ============================================================
 ============================================================
-TEST 6: put left/right: expect: ba!XX!12BAYY34ba!\l_XX_tl !12
+TEST 6: \draw_point_intersect_lines:nnnn 
 ============================================================
-> \l_YY_tl=ba!XX!12BAYY34ba!\l_XX_tl !12.
+{28.45274353027345pt}{-0.000000000000008234940062507525pt}
+{10.51038833340825pt}{10.51038833340825pt}
 ============================================================
 ============================================================
-TEST 7: test \tl_to_str:N expect: ba!XX!12BAYY34ba!\l_XX_tl !12####1
+TEST 7: \draw_point_intersect_circles:nnnnn 
 ============================================================
-ba!XX!12BAYY34ba!\l_XX_tl !12####1
+{-0.00001237523567pt}{-0.00001237523569pt}
 ============================================================
 ============================================================
-TEST 8: testing ##: expect########1########2####3 ####1####2##1##2
+TEST 8: \draw_set_ <axis>vec:n
 ============================================================
-> \l_YY_tl=########1########2####3.
-> \g_ZZ_tl=####1####2##1##2.
+> {17.49859619140625pt}{17.49859619140625pt}.
+<recently read> }
+l. ...  }
+> {17.49859619140625pt}{45.95133972167969pt}.
+<recently read> }
+l. ...  }
+> {45.95133972167969pt}{45.95133972167969pt}.
+<recently read> }
+l. ...  }
+> {85.35823059082032pt}{85.35823059082032pt}.
+<recently read> }
+l. ...  }
 ============================================================
 ============================================================
-TEST 9: testing set_eq: expect abc xyz
+TEST 9: \draw_point_vec_coord:nn 
 ============================================================
-> \l_tmpb_tl=abc.
-> \g_ZZ_tl=xyz.
+{0pt}{0pt}
+{28.45274353027344pt}{28.45274353027344pt}
+{28.45274353027344pt}{56.90548706054688pt}
+{28.45274353027344pt}{28.45274353027344pt}
 ============================================================
 ============================================================
-TEST 10: test for empty: expect YES NO !! NO
+TEST 10: \draw_point_vec_coord:nnn 
 ============================================================
-YES NO !! NO
+{0pt}{0pt}
+{-10.95414733886719pt}{-10.95414733886719pt}
+{0pt}{28.45274353027344pt}
+{-10.95414733886719pt}{17.49859619140625pt}
 ============================================================
 ============================================================
-TEST 11: test for equal: expect YES YES !! NO
+TEST 11: \draw_point_vec_polar:nn 
 ============================================================
-YES YES !! NO
+{49.28159740916025pt}{28.45274353027344pt}
+{24.64079870458013pt}{28.45274353027344pt}
 ============================================================





More information about the latex3-commits mailing list