diff options
author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2010-03-11 16:57:59 +0100 |
---|---|---|
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2010-03-11 16:57:59 +0100 |
commit | aea103a1f2d2604cd5ae6883e6e808930f7ccef4 (patch) | |
tree | 7de177c7d5042b4f598d108269c643a516f2a78e | |
parent | 6fd9e351fad8a6d4df2d2841a29da7fa99806463 (diff) | |
download | luatexbase-aea103a1f2d2604cd5ae6883e6e808930f7ccef4.tar.gz |
Add basic test files for attr.
-rw-r--r-- | Makefile | 11 | ||||
-rw-r--r-- | TODO | 8 | ||||
-rw-r--r-- | luatexbase-attr.dtx | 39 | ||||
-rw-r--r-- | luatexbase-regs.dtx | 2 |
4 files changed, 48 insertions, 12 deletions
@@ -9,7 +9,9 @@ DTXSTY = lltxb-dtxstyle.tex UNPACKED_MCB = test-luamcallbacks.tex luamcallbacks.lua UNPACKED_REGS = luatexbase-regs.sty \ test-regs-plain.tex test-regs-latex.tex -UNPACKED = $(UNPACKED_MCB) $(UNPACKED_REGS) +UNPACKED_ATTR = luatexbase-attr.sty luatexbase.attr.lua \ + test-attr-plain.tex test-attr-latex.tex +UNPACKED = $(UNPACKED_MCB) $(UNPACKED_REGS) $(UNPACKED_ATTR) COMPILED = $(DOC) GENERATED = $(COMPILED) $(UNPACKED) SOURCE = $(DTX) $(DTXSTY) README TODO Changes Makefile @@ -59,10 +61,17 @@ $(UNPACKED_MCB): luamcallbacks.dtx $(UNPACKED_REGS): luatexbase-regs.dtx $(DO_TEX) +$(UNPACKED_ATTR): luatexbase-attr.dtx + $(DO_TEX) + check-regs: $(UNPACKED_REGS) luatex --interaction=batchmode test-regs-plain.tex >/dev/null lualatex --interaction=batchmode test-regs-latex.tex >/dev/null +check-attr: $(UNPACKED_ATTR) + luatex --interaction=batchmode test-attr-plain.tex >/dev/null + lualatex --interaction=batchmode test-attr-latex.tex >/dev/null + $(CTAN_ZIP): $(SOURCE) $(COMPILED) $(TDS_ZIP) @echo "Making $@ for CTAN upload." @$(RM) -- $@ @@ -1,14 +1,14 @@ general ------- +- write test files - change prefix for internal TeX macros - check for lua name conflicts ('module' used in mods) - check for macros starting with \luatex -- write test files -- reload check, declaration, luatex test -- handle catcodes for Plain (more comprensive defenses to be added later) -- import/update doc - make TeX tests cleaner: \begingroup\expandafter\ETC. +- reload check, declaration, luatex test, catcodes for plain +- import/update doc +- date & changes entry Later diff --git a/luatexbase-attr.dtx b/luatexbase-attr.dtx index 8f68efc..4af129c 100644 --- a/luatexbase-attr.dtx +++ b/luatexbase-attr.dtx @@ -11,7 +11,8 @@ % % This work consists of the main source file luatexbase-attr.dtx % and the derived files -% luatexbase-attr.sty luatexbase.attr.lua ... +% luatexbase-attr.sty luatexbase.attr.lua +% test-regs-plain.tex test-regs-latex.tex % % Unpacking: % tex luatexbase-attr.dtx @@ -57,6 +58,12 @@ and the derived files \file{luatexbase-attr.sty}{\from{luatexbase-attr.dtx}{texpackage}}% } +\generate{% + \usedir{doc/luatex/luatexbase}% + \file{test-attr-plain.tex}{\from{luatexbase-attr.dtx}{testplain}}% + \file{test-attr-latex.tex}{\from{luatexbase-attr.dtx}{testlatex}}% +} + \def\MetaPrefix{-- } \def\luapostamble{% @@ -107,7 +114,7 @@ and the derived files % Dollar \$ Percent \% Ampersand \& % Acute accent \' Left paren \( Right paren \) % Asterisk \* Plus \+ Comma \, - Minus \- Point \. Solidus \/ +% Minus \- Point \. Solidus \/ % Colon \: Semicolon \; Less than \< % Equals \= Greater than \> Question mark \? % Commercial at \@ Left bracket \[ Backslash \\ @@ -115,8 +122,6 @@ and the derived files % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % -% \GetFileInfo{luatexbase-attr.drv} -% % \title{The \pk{luatexbase-attr} package} % \date{DATE} % \author{% @@ -153,10 +158,11 @@ and the derived files \ifluatex \global\luatexattributedef#1=\allocationnumber \fi - \wlog{\string#1=\string\luatexattribute\the\allocationnumber}% + \unsetluatexattribute#1% \begingroup\escapechar\m@ne \expandafter\endgroup \directlua{luatextra.attributedef_from_tex( '\luatexluaescapestring{\string#1}', '\number\allocationnumber')}% + \wlog{\string#1=\string\luatexattribute\the\allocationnumber}% \else \errmessage{No room for a new \string\attribute}% \fi} @@ -218,5 +224,28 @@ end %</luamodule> % \end{macrocode} % +% \section{Test files} +% +% The tests done are very basic: we just make sure that the package loads +% correctly and the macros don't generate any error, under both LaTeX en +% Plain TeX. +% +% \begin{macrocode} +%<testplain>\input luatexbase-attr.sty +%<testlatex>\RequirePackage{luatexbase-attr} +%<*testplain,testlatex> +\newluatexattribute\testattr +\setluatexattribute\testattr{1} +\unsetluatexattribute\testattr +\begingroup +\newluatexattribute\anotherattr +\endgroup +\setluatexattribute\anotherattr{1} +%</testplain,testlatex> +%<testplain>\bye +%<testlatex>\stop +% \end{macrocode} +% +% % \Finale \endinput diff --git a/luatexbase-regs.dtx b/luatexbase-regs.dtx index 1322103..11b7013 100644 --- a/luatexbase-regs.dtx +++ b/luatexbase-regs.dtx @@ -110,8 +110,6 @@ and the derived files % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % -% \GetFileInfo{luatexbase-regs.drv} -% % \title{The \pk{luatexbase-regs} package} % \date{2010/01/21 v0.1} % \author{% |