-
-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests and correct some issues as a result
Not sure about the msg from \SetKeysOptions: formally, it takes the family not the package name.
- Loading branch information
1 parent
a291002
commit 0313484
Showing
3 changed files
with
91 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
\documentclass{article} | ||
\begin{filecontents}{mypkg.sty} | ||
\DeclareKeysOptions{ | ||
load-option-A .store = \my@A , | ||
load-option-A .usage = load , | ||
load-option-B .store = \my@B , | ||
load-option-B .usage = load , | ||
general-option-C .store = \my@C | ||
} | ||
\ProcessKeysOptions | ||
\newcommand\mypkgtest{% | ||
\begingroup | ||
\edef\x{\my@A:\my@B:\my@C}% | ||
\show\x | ||
\endgroup | ||
} | ||
\end{filecontents} | ||
\input{test2e} | ||
|
||
\START | ||
\AUTHOR{Joseph Wright} | ||
|
||
\usepackage[load-option-A = 111]{mypkg} % 1 | ||
\mypkgtest | ||
\usepackage[load-option-A = 222]{mypkg} % 2 | ||
\mypkgtest | ||
\usepackage[load-option-A = 333, general-option-C = 333]{mypkg} % 3 | ||
\mypkgtest | ||
\usepackage{mypkg} % 4 | ||
\mypkgtest | ||
\usepackage[load-option-B = 555]{mypkg} % 5 | ||
\mypkgtest | ||
\SetKeysOptions[mypkg]{load-option-A = 666} % 6 | ||
\mypkgtest | ||
|
||
\END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
This is a generated file for the LaTeX2e validation system. | ||
Don't change this file in any respect. | ||
Author: Joseph Wright | ||
(mypkg.sty) | ||
> \x=macro: | ||
->111::. | ||
\mypkgtest ...f \x {\my@A :\my@B :\my@C }\show \x | ||
\endgroup | ||
l. ...\mypkgtest | ||
LaTeX3 Warning: Package "mypkg" has already been loaded: ignoring load-time | ||
(LaTeX3) option "load-option-A". | ||
> \x=macro: | ||
->111::. | ||
\mypkgtest ...f \x {\my@A :\my@B :\my@C }\show \x | ||
\endgroup | ||
l. ...\mypkgtest | ||
LaTeX3 Warning: Package "mypkg" has already been loaded: ignoring load-time | ||
(LaTeX3) option "load-option-A". | ||
> \x=macro: | ||
->111::333. | ||
\mypkgtest ...f \x {\my@A :\my@B :\my@C }\show \x | ||
\endgroup | ||
l. ...\mypkgtest | ||
> \x=macro: | ||
->111::333. | ||
\mypkgtest ...f \x {\my@A :\my@B :\my@C }\show \x | ||
\endgroup | ||
l. ...\mypkgtest | ||
LaTeX3 Warning: Package "mypkg" has already been loaded: ignoring load-time | ||
(LaTeX3) option "load-option-B". | ||
> \x=macro: | ||
->111::333. | ||
\mypkgtest ...f \x {\my@A :\my@B :\my@C }\show \x | ||
\endgroup | ||
l. ...\mypkgtest | ||
! LaTeX3 Error: Key "load-option-A" may only be used in the during loading of | ||
(LaTeX3) package "mypkg". | ||
For immediate help type H <return>. | ||
... | ||
l. ...\SetKeysOptions[mypkg]{load-option-A = 666} | ||
% 6 | ||
LaTeX was asked to set a key called "load-option-A", but this is only allowed | ||
in the optional argument when loading package "mypkg". | ||
> \x=macro: | ||
->111::333. | ||
\mypkgtest ...f \x {\my@A :\my@B :\my@C }\show \x | ||
\endgroup | ||
l. ...\mypkgtest |