summaryrefslogtreecommitdiff
path: root/luatexbase-attr.dtx
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2010-03-11 16:57:59 +0100
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2010-03-11 16:57:59 +0100
commitaea103a1f2d2604cd5ae6883e6e808930f7ccef4 (patch)
tree7de177c7d5042b4f598d108269c643a516f2a78e /luatexbase-attr.dtx
parent6fd9e351fad8a6d4df2d2841a29da7fa99806463 (diff)
downloadluatexbase-aea103a1f2d2604cd5ae6883e6e808930f7ccef4.tar.gz
Add basic test files for attr.
Diffstat (limited to 'luatexbase-attr.dtx')
-rw-r--r--luatexbase-attr.dtx39
1 files changed, 34 insertions, 5 deletions
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