summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/oberdiek/iflang.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/oberdiek/iflang.dtx')
-rw-r--r--macros/latex/contrib/oberdiek/iflang.dtx343
1 files changed, 1 insertions, 342 deletions
diff --git a/macros/latex/contrib/oberdiek/iflang.dtx b/macros/latex/contrib/oberdiek/iflang.dtx
index c5f2b85ae9..fa784b7d45 100644
--- a/macros/latex/contrib/oberdiek/iflang.dtx
+++ b/macros/latex/contrib/oberdiek/iflang.dtx
@@ -67,11 +67,6 @@
% Installation:
% TDS:tex/generic/oberdiek/iflang.sty
% TDS:doc/latex/oberdiek/iflang.pdf
-% TDS:doc/latex/oberdiek/test/iflang-test1.tex
-% TDS:doc/latex/oberdiek/test/iflang-test2.tex
-% TDS:doc/latex/oberdiek/test/iflang-test3.tex
-% TDS:doc/latex/oberdiek/test/iflang-test4.tex
-% TDS:doc/latex/oberdiek/test/iflang-test5.tex
% TDS:source/latex/oberdiek/iflang.dtx
%
%<*ignore>
@@ -147,10 +142,6 @@ and the derived files
% \file{iflang-test3.tex}{\from{iflang.dtx}{test3}}%
% \file{iflang-test4.tex}{\from{iflang.dtx}{test4}}%
% \file{iflang-test5.tex}{\from{iflang.dtx}{test5}}%
- \nopreamble
- \nopostamble
-% \usedir{source/latex/oberdiek/catalogue}%
-% \file{iflang.xml}{\from{iflang.dtx}{catalogue}}%
}
\catcode32=13\relax% active space
@@ -187,21 +178,6 @@ and the derived files
% \fi
%
%
-% \CharacterTable
-% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
-% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
-% Digits \0\1\2\3\4\5\6\7\8\9
-% Exclamation \! Double quote \" Hash (number) \#
-% Dollar \$ Percent \% Ampersand \&
-% Acute accent \' Left paren \( Right paren \)
-% Asterisk \* Plus \+ Comma \,
-% Minus \- Point \. Solidus \/
-% Colon \: Semicolon \; Less than \<
-% Equals \= Greater than \> Question mark \?
-% Commercial at \@ Left bracket \[ Backslash \\
-% Right bracket \] Circumflex \^ Underscore \_
-% Grave accent \` Left brace \{ Vertical bar \|
-% Right brace \} Tilde \~}
%
% \GetFileInfo{iflang.drv}
%
@@ -677,319 +653,7 @@ and the derived files
\IfLang@AtEnd%
%</package>
% \end{macrocode}
-%
-% \section{Test}
-%
-% \subsection{Catcode checks for loading}
-%
-% \begin{macrocode}
-%<*test1>
-% \end{macrocode}
-% \begin{macrocode}
-\catcode`\{=1 %
-\catcode`\}=2 %
-\catcode`\#=6 %
-\catcode`\@=11 %
-\expandafter\ifx\csname count@\endcsname\relax
- \countdef\count@=255 %
-\fi
-\expandafter\ifx\csname @gobble\endcsname\relax
- \long\def\@gobble#1{}%
-\fi
-\expandafter\ifx\csname @firstofone\endcsname\relax
- \long\def\@firstofone#1{#1}%
-\fi
-\expandafter\ifx\csname loop\endcsname\relax
- \expandafter\@firstofone
-\else
- \expandafter\@gobble
-\fi
-{%
- \def\loop#1\repeat{%
- \def\body{#1}%
- \iterate
- }%
- \def\iterate{%
- \body
- \let\next\iterate
- \else
- \let\next\relax
- \fi
- \next
- }%
- \let\repeat=\fi
-}%
-\def\RestoreCatcodes{}
-\count@=0 %
-\loop
- \edef\RestoreCatcodes{%
- \RestoreCatcodes
- \catcode\the\count@=\the\catcode\count@\relax
- }%
-\ifnum\count@<255 %
- \advance\count@ 1 %
-\repeat
-
-\def\RangeCatcodeInvalid#1#2{%
- \count@=#1\relax
- \loop
- \catcode\count@=15 %
- \ifnum\count@<#2\relax
- \advance\count@ 1 %
- \repeat
-}
-\def\RangeCatcodeCheck#1#2#3{%
- \count@=#1\relax
- \loop
- \ifnum#3=\catcode\count@
- \else
- \errmessage{%
- Character \the\count@\space
- with wrong catcode \the\catcode\count@\space
- instead of \number#3%
- }%
- \fi
- \ifnum\count@<#2\relax
- \advance\count@ 1 %
- \repeat
-}
-\def\space{ }
-\expandafter\ifx\csname LoadCommand\endcsname\relax
- \def\LoadCommand{\input iflang.sty\relax}%
-\fi
-\def\Test{%
- \RangeCatcodeInvalid{0}{47}%
- \RangeCatcodeInvalid{58}{64}%
- \RangeCatcodeInvalid{91}{96}%
- \RangeCatcodeInvalid{123}{255}%
- \catcode`\@=12 %
- \catcode`\\=0 %
- \catcode`\%=14 %
- \LoadCommand
- \RangeCatcodeCheck{0}{36}{15}%
- \RangeCatcodeCheck{37}{37}{14}%
- \RangeCatcodeCheck{38}{47}{15}%
- \RangeCatcodeCheck{48}{57}{12}%
- \RangeCatcodeCheck{58}{63}{15}%
- \RangeCatcodeCheck{64}{64}{12}%
- \RangeCatcodeCheck{65}{90}{11}%
- \RangeCatcodeCheck{91}{91}{15}%
- \RangeCatcodeCheck{92}{92}{0}%
- \RangeCatcodeCheck{93}{96}{15}%
- \RangeCatcodeCheck{97}{122}{11}%
- \RangeCatcodeCheck{123}{255}{15}%
- \RestoreCatcodes
-}
-\Test
-\csname @@end\endcsname
-\end
-% \end{macrocode}
-% \begin{macrocode}
-%</test1>
-% \end{macrocode}
-%
-% \subsection{Test with \LaTeX}
-%
-% \begin{macrocode}
-%<*test2|test3>
-% \end{macrocode}
-% \begin{macrocode}
-\NeedsTeXFormat{LaTeX2e}
-%<test3>\let\pdfstrcmp\relax
-\nofiles
-\documentclass{minimal}
-\usepackage{qstest}
-\IncludeTests{*}
-\LogTests{log}{*}{*}
-\usepackage[english,naustrian,ngerman]{babel}
-\usepackage{iflang}
-\begin{document}
-\begin{qstest}{IfLanguagePatterns}{language, pattern}
- \def\test#1#2{%
- \Expect*{\IfLanguagePatterns{#1}{true}{false}}{#2}%
- }%
- \test{ngerman}{true}%
- \test{naustrian}{true}%
- \test{english}{false}%
- \test{foobar}{false}%
-\end{qstest}
-\begin{qstest}{IfLanguageName}{language, name}
- \def\test#1#2{%
- \Expect*{\IfLanguageName{#1}{true}{false}}{#2}%
- }%
- \test{ngerman}{true}%
- \test{naustrian}{false}%
- \selectlanguage{naustrian}%
- \test{ngerman}{false}%
- \test{naustrian}{true}%
- \test{foobar}{false}%
- %
- \def\languagename{naustrian}%
- \test{naustrian}{true}%
- \test{ngerman}{false}%
- %
- \edef\languagename{\string naustrian}%
- \test{naustrian}{true}%
- \test{ngerman}{false}%
- %
- \def\languagename{naustrian}%
- \makeatletter
- \@onelevel@sanitize\languagename
- \test{naustrian}{true}%
- \test{ngerman}{false}%
- %
- \def\languagename{naustrian}%
- \def\xaustrian{naustrian}%
- \def\xgerman{ngerman}%
- \test{\xaustrian}{true}%
- \test{\xgerman}{false}%
- %
- \def\languagename{\xaustrian}%
- \test{naustrian}{true}%
- \test{ngerman}{false}%
- \test{\xaustrian}{true}%
- \test{\xgerman}{false}%
- \test{\languagename}{true}%
- \test{\languagename\space}{false}%
- %
- \def\languagename{\empty\xaustrian\empty}%
- \test{naustrian}{true}%
- \test{ngerman}{false}%
- \test{\empty\xaustrian\empty}{true}%
- \test{\empty\xgerman\empty}{false}%
-\end{qstest}
-\begin{qstest}{IfDefined}{defined}
- \makeatletter
- \let\foobar\relax
- \Expect*{\IfLang@IfDefined{foobar}{true}{false}}{false}%
- \Expect*{\ifx\foobar\relax true\else false\fi}{true}%
- \let\foobar\UNDEFINED
- \Expect*{\IfLang@IfDefined{foobar}{true}{false}}{false}%
- \Expect*{\ifx\foobar\relax true\else false\fi}{false}%
- \Expect*{\ifx\foobar\UNDEFINED true\else false\fi}{true}%
-\end{qstest}
-\end{document}
-% \end{macrocode}
-% \begin{macrocode}
-%</test2|test3>
-% \end{macrocode}
-%
-% \subsection{Test with \plainTeX\ and \eTeX}
-%
-% \begin{macrocode}
-%<*test4>
-% \end{macrocode}
-% \begin{macrocode}
-%% Format `etex' based on `language.def'
-\input iflang.sty
-\catcode64=12
-
-\def\TestGeneric#1#2#3{%
- \begingroup
- \edef\x{#1{#2}{true}{false}}%
- \edef\y{#3}%
- \ifx\x\y
- \else
- \errmessage{Failed test: \string#1{#2} <> #3}%
- \fi
- \endgroup
-}
-\def\TestPatterns{\TestGeneric\IfLanguagePatterns}
-\def\TestName{\TestGeneric\IfLanguageName}
-
-\TestPatterns{USenglish}{true}
-\TestPatterns{ngerman}{false}
-
-\TestName{USenglish}{true}
-\TestName{ngerman}{false}
-
-\uselanguage{ngerman}
-
-\TestPatterns{USenglish}{false}
-\TestPatterns{ngerman}{true}
-
-\TestName{USenglish}{false}
-\TestName{ngerman}{true}
-
-\csname @@end\endcsname
-\end
-% \end{macrocode}
-% \begin{macrocode}
-%</test4>
-% \end{macrocode}
-%
-% \subsection{Test with \plainTeX\ and without \eTeX/\pdfTeX}
-%
-% \begin{macrocode}
-%<*test5>
-% \end{macrocode}
-% \begin{macrocode}
-%% Format `tex' (vanilla plain-TeX)
-\let\ifcsname\UNDEFINED
-\let\pdfstrcmp\UNDEFINED
-\input iflang.sty
-\catcode64=11
-
-\def\TestDefined#1{%
- \IfLang@IfDefined{foobar}{}{}%
- \ifx\foobar#1%
- \else
- \errmessage{Failed test: \string\foobar <> \string#1}%
- \fi
-}
-\let\foobar\relax
-\TestDefined\relax
-\let\foobar\UNDEFINED
-\TestDefined\relax
-
-\def\strip@prefix#1>{}
-\def\@onelevel@sanitize#1{%
- \edef#1{\expandafter\strip@prefix\meaning#1}%
-}
-\def\TestCompare#1#2#3{%
- \begingroup
- \edef\x{%
- \if\IfLang@StrEqual{#1}{#2}%
- true%
- \else
- false%
- \fi
- }%
- \def\expect{#3}%
- \ifx\x\expect
- \else
- \def\a{#1}%
- \@onelevel@sanitize\a
- \def\b{#2}%
- \@onelevel@sanitize\b
- \errmessage{Failed test: `\a'='\b' <> \expect}%
- \fi
- \endgroup
-}
-\TestCompare{junk}{junk}{true}
-\TestCompare{}{}{true}
-\TestCompare{a}{b}{false}
-\TestCompare{aa}{bb}{false}
-\def\a{ax}
-\def\b{bx}
-\def\c{\a\b}
-\def\d{\c\b}
-\def\exch#1#2{#2#1}
-\def\gobble#1{}
-\TestCompare{\gobble a}{}{true}
-\TestCompare{}{\gobble a}{true}
-\TestCompare{a\exch xyb}{ayxb}{true}
-\TestCompare{\c}{\c}{true}
-\TestCompare{\d}{\c\b}{true}
-
-\csname @@end\endcsname
-\end
-% \end{macrocode}
-% \begin{macrocode}
-%</test5>
-% \end{macrocode}
-%
-% \section{Installation}
+%% \section{Installation}
%
% \subsection{Download}
%
@@ -1038,11 +702,6 @@ and the derived files
% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}}
% iflang.sty & tex/generic/oberdiek/iflang.sty\\
% iflang.pdf & doc/latex/oberdiek/iflang.pdf\\
-% test/iflang-test1.tex & doc/latex/oberdiek/test/iflang-test1.tex\\
-% test/iflang-test2.tex & doc/latex/oberdiek/test/iflang-test2.tex\\
-% test/iflang-test3.tex & doc/latex/oberdiek/test/iflang-test3.tex\\
-% test/iflang-test4.tex & doc/latex/oberdiek/test/iflang-test4.tex\\
-% test/iflang-test5.tex & doc/latex/oberdiek/test/iflang-test5.tex\\
% iflang.dtx & source/latex/oberdiek/iflang.dtx\\
% \end{tabular}^^A
% }^^A