[latex3-commits] [git/LaTeX3-latex3-latex2e] develop: Initial prototype tests (ef5ef6d1)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu Mar 10 15:32:12 CET 2022


Repository : https://github.com/latex3/latex2e
On branch  : develop
Link       : https://github.com/latex3/latex2e/commit/ef5ef6d109c1f23641502911bf957f762e4c3195

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

commit ef5ef6d109c1f23641502911bf957f762e4c3195
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Tue Mar 8 22:22:26 2022 +0000

    Initial prototype tests


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

ef5ef6d109c1f23641502911bf957f762e4c3195
 .../latex-lab/testfiles/latex-lab-prototype000.lvt |  6 +-
 .../testfiles/latex-lab-prototype000.tlg}          |  2 +-
 .../latex-lab/testfiles/latex-lab-prototype001.lvt | 30 ++++++++
 .../latex-lab/testfiles/latex-lab-prototype001.tlg | 46 +++++++++++
 .../latex-lab/testfiles/latex-lab-prototype002.lvt | 90 ++++++++++++++++++++++
 .../latex-lab/testfiles/latex-lab-prototype002.tlg | 21 +++++
 6 files changed, 192 insertions(+), 3 deletions(-)

diff --git a/base/testfiles-ltcmd/ltcmd000.lvt b/required/latex-lab/testfiles/latex-lab-prototype000.lvt
similarity index 68%
copy from base/testfiles-ltcmd/ltcmd000.lvt
copy to required/latex-lab/testfiles/latex-lab-prototype000.lvt
index 99910250..eab22d6a 100644
--- a/base/testfiles-ltcmd/ltcmd000.lvt
+++ b/required/latex-lab/testfiles/latex-lab-prototype000.lvt
@@ -1,3 +1,6 @@
+%
+% Copyright (C) 2022 LaTeX Project
+%
 
 \documentclass{minimal}
 \input{regression-test}
@@ -7,6 +10,5 @@
 \ExplSyntaxOff
 
 \START
-\AUTHOR{Bruno Le Floch}
-% \RequirePackage{xparse}
+\RequirePackage{latex-lab-prototype}
 \END
diff --git a/required/amsmath/testfiles-TU/tlb-lualatex-math-move.tlg b/required/latex-lab/testfiles/latex-lab-prototype000.tlg
similarity index 79%
copy from required/amsmath/testfiles-TU/tlb-lualatex-math-move.tlg
copy to required/latex-lab/testfiles/latex-lab-prototype000.tlg
index 8741b5c9..9e36aaaa 100644
--- a/required/amsmath/testfiles-TU/tlb-lualatex-math-move.tlg
+++ b/required/latex-lab/testfiles/latex-lab-prototype000.tlg
@@ -1,3 +1,3 @@
 This is a generated file for the l3build validation system.
 Don't change this file in any respect.
-test only for lualatex
+(latex-lab-prototype.sty)
diff --git a/required/latex-lab/testfiles/latex-lab-prototype001.lvt b/required/latex-lab/testfiles/latex-lab-prototype001.lvt
new file mode 100644
index 00000000..9b5fb6e9
--- /dev/null
+++ b/required/latex-lab/testfiles/latex-lab-prototype001.lvt
@@ -0,0 +1,30 @@
+%
+% Copyright (C) 2022 LaTeX Project
+%
+
+\documentclass{minimal}
+\input{regression-test}
+\RequirePackage[enable-debug]{expl3}
+\ExplSyntaxOn
+\debug_on:n { check-declarations , deprecation , log-functions }
+\ExplSyntaxOff
+\RequirePackage{latex-lab-prototype}
+
+\begin{document}
+\START
+\ExplSyntaxOn
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\TEST{Making~object~types}{
+  \prototype_declare_object:nn { test } { 0 }
+  \prototype_declare_object:nn { test } { 1 }
+  \prototype_declare_object:nn { test } { 2 }
+}
+
+\TEST{Making~object~types: errors}{
+  \prototype_declare_object:nn { test } { -1 }
+  \prototype_declare_object:nn { test } { 10 }
+  \prototype_declare_object:nn { test } { i }
+}
+
+\END
diff --git a/required/latex-lab/testfiles/latex-lab-prototype001.tlg b/required/latex-lab/testfiles/latex-lab-prototype001.tlg
new file mode 100644
index 00000000..dcc38dcf
--- /dev/null
+++ b/required/latex-lab/testfiles/latex-lab-prototype001.tlg
@@ -0,0 +1,46 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+============================================================
+TEST 1: Making object types
+============================================================
+Package prototype Info: Declaring object type 'test' taking 0 argument(s).
+Package prototype Info: Declaring object type 'test' taking 1 argument(s).
+Package prototype Info: Declaring object type 'test' taking 2 argument(s).
+============================================================
+============================================================
+TEST 2: Making object types:errors
+============================================================
+! Package prototype Error: Bad number of arguments for object type 'test'.
+For immediate help type H <return>.
+ ...                                              
+l. ...}
+An object may accept between 0 and 9 arguments.
+You asked to use -1 arguments: this is not supported.
+! Package prototype Error: Bad number of arguments for object type 'test'.
+For immediate help type H <return>.
+ ...                                              
+l. ...}
+An object may accept between 0 and 9 arguments.
+You asked to use 10 arguments: this is not supported.
+! Missing number, treated as zero.
+<to be read again> 
+                   i
+l. ...}
+A number should have been here; I inserted `0'.
+(If you can't figure out why I needed to see a number,
+look up `weird error' in the index to The TeXbook.)
+! Use of \??? doesn't match its definition.
+<argument> \???  
+                 ! LaTeX3 Error: Relation 'i' not among =,<,>,==,!=,<=,>=.
+l. ...}
+If you say, e.g., `\def\a1{...}', then you must always
+put `1' after `\a', since control sequence names are
+made up of letters only. The macro here has not been
+followed by the required stuff, so I'm ignoring it.
+! Package prototype Error: Bad number of arguments for object type 'test'.
+For immediate help type H <return>.
+ ...                                              
+l. ...}
+An object may accept between 0 and 9 arguments.
+You asked to use 0i\__int_eval_end:  arguments: this is not supported.
+============================================================
diff --git a/required/latex-lab/testfiles/latex-lab-prototype002.lvt b/required/latex-lab/testfiles/latex-lab-prototype002.lvt
new file mode 100644
index 00000000..87b3a822
--- /dev/null
+++ b/required/latex-lab/testfiles/latex-lab-prototype002.lvt
@@ -0,0 +1,90 @@
+%
+% Copyright (C) 2009,2017,2018,2022 LaTeX3 Project
+%
+
+\documentclass{minimal}
+\input{regression-test}
+
+\RequirePackage[enable-debug]{expl3}
+\ExplSyntaxOn
+\debug_on:n { check-declarations , deprecation , log-functions }
+\ExplSyntaxOff
+\RequirePackage{latex-lab-prototype}
+
+\begin{document}
+\START
+\ExplSyntaxOn
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\OMIT
+\def\aaa{}\def\bbb{}\def\ccc{}
+\prototype_declare_object:nn {obj}{0}
+\prototype_declare_template:nnnn {obj}{tmpt1}
+{
+  akey .tl_set:N  = \aaa ,
+  bkey .tl_set:N  = \bbb ,
+  ckey .tl_gset:N = \ccc ,
+}
+{
+  \typeout{(a:~\aaa)~(b:~\bbb)~(c:~\ccc)}
+}
+\prototype_declare_defaults:nnn {obj} {tmpt1} { bkey = fuzz }
+\prototype_declare_instance:nnnn {obj}{tmpt1}{inst} {akey=foo}
+\prototype_declare_instance:nnnn {obj}{tmpt1}{inst2}{akey=bar,bkey=baz,ckey=glob}
+\TIMO
+
+\TEST{Testing~TOKENLIST~keytype}{
+  \group_begin:
+    \prototype_use_instance:nn {obj}{inst}
+    \prototype_use_instance:nn {obj}{inst2}
+  \group_end:
+  \TYPE{(a:~\aaa)~(b:~\bbb)~(c:~\ccc)}
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\OMIT
+\prototype_declare_template:nnnn{obj}{tmpt2}
+{
+  akey .code:n = \def\aaa{#1},
+}
+{
+  \TYPE{(a:~\aaa)}
+}
+
+\prototype_declare_instance:nnnn {obj}{tmpt2}{inst3} {akey=a!}
+\TIMO
+
+\TEST{Testing~CODE~keytype}{
+  \prototype_use_instance:nn{obj}{inst3}
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\OMIT
+\prototype_declare_template:nnnn{obj}{tmpt3}
+  {
+  ckey .choice: ,
+  ckey / xx .code:n = \def\ccc{keyx},
+  ckey / yy .code:n = \def\ccc{keyy},
+  ckey / unknown .code:n = \def\ccc{key?} ,
+  }
+{
+  \typeout{(c:~\ccc)}
+}
+
+\prototype_declare_instance:nnnn {obj} {tmpt3}{inst4}{ckey=xx}
+\prototype_declare_instance:nnnn {obj} {tmpt3}{inst5}{ckey=yy}
+\prototype_declare_instance:nnnn {obj} {tmpt3}{inst6}{ckey=zz}
+\TIMO
+
+\TEST{Testing~CHOICE~keytype}{
+  \prototype_use_instance:nn{obj}{inst4}
+  \prototype_use_instance:nn{obj}{inst5}
+  \prototype_use_instance:nn{obj}{inst6}
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\END
diff --git a/required/latex-lab/testfiles/latex-lab-prototype002.tlg b/required/latex-lab/testfiles/latex-lab-prototype002.tlg
new file mode 100644
index 00000000..8efc94a1
--- /dev/null
+++ b/required/latex-lab/testfiles/latex-lab-prototype002.tlg
@@ -0,0 +1,21 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+============================================================
+TEST 1: Testing TOKENLIST keytype
+============================================================
+(a: foo) (b: fuzz) (c: )
+(a: bar) (b: baz) (c: glob)
+(a: ) (b: ) (c: glob)
+============================================================
+============================================================
+TEST 2: Testing CODE keytype
+============================================================
+(a: a!)
+============================================================
+============================================================
+TEST 3: Testing CHOICE keytype
+============================================================
+(c: keyx)
+(c: keyy)
+(c: key?)
+============================================================





More information about the latex3-commits mailing list.