%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /data/old/usr/share/texlive/texmf-dist/doc/latex/oberdiek/test/
Upload File :
Create Path :
Current File : //data/old/usr/share/texlive/texmf-dist/doc/latex/oberdiek/test/askinclude-test4.tex

%%
%% This is file `askinclude-test4.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% askinclude.dtx  (with options: `test0,test4')
%% 
%% This is a generated file.
%% 
%% Project: askinclude
%% Version: 2011/12/02 v2.2
%% 
%% Copyright (C) 1991-1994 by Pablo A. Straub
%% Copyright (C) 2007, 2008, 2011 by
%%    Heiko Oberdiek <heiko.oberdiek at googlemail.com>
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3c of this license or (at your option) any later
%% version. This version of this license is in
%%    http://www.latex-project.org/lppl/lppl-1-3c.txt
%% and the latest version of this license is in
%%    http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
%% 
%% This work has the LPPL maintenance status "maintained".
%% 
%% This Current Maintainer of this work is Heiko Oberdiek.
%% 
%% This work consists of the main source file askinclude.dtx
%% and the derived files
%%    askinclude.sty, askinclude.pdf, askinclude.ins, askinclude.drv,
%%    askinclude.bib, askinclude-a.tex, askinclude-b.tex,
%%    askinclude-c.tex, askinclude-test1.tex,
%%    askinclude-test2.tex, askinclude-test3.tex,
%%    askinclude-test4.tex, askinclude-test5.tex,
%%    askinclude-test6.tex, askinclude-test7.tex,
%%    askinclude-test8.tex, askinclude-test9.tex,
%%    askinclude-test10.tex, askinclude-test11.tex,
%%    askinclude-test12.tex, askinclude-test13.tex,
%%    askinclude-test14.tex, askinclude-test15.tex,
%%    askinclude-test16.tex, askinclude-test17.tex,
%%    askinclude-test18.tex, askinclude-test19.tex,
%%    askinclude-test20.tex, askinclude-test21.tex,
%%    askinclude-test22.tex, askinclude-test23.tex,
%%    askinclude-test24.tex.
%% 
\ifx\CompatibilityMode Y%
  \documentstyle[filecontents,qstest,askinclude]{book}%
\else
  \documentclass{book}%
  \usepackage{filecontents}%
  \usepackage{qstest}%
  \ifx\AtBeginDocumentMode Y%
    \AtBeginDocument{%
      \usepackage{askinclude}[2011/12/02]%
    }%
  \else
    \usepackage{askinclude}[2011/12/02]%
  \fi
\fi
\IncludeTests{*}
\LogTests{log}{*}{*}
\makeatletter
\let\org@typein\typein
\def\typein[#1]#2{%
  \ifx\@Stack\@StackEmpty
    \begin{qstest}{StackNonEmpty}{StackNonEmpty}%
      \Expect{Error: empty stack}{}%
    \end{qstest}%
    \org@typein[{#1}]{#2}%
  \else
    \edef#1{%
      \unexpanded\expandafter\expandafter\expandafter{%
        \expandafter\@car\@Stack\@nil
      }%
    }%
    \xdef\@Stack{%
      \unexpanded\expandafter\expandafter\expandafter{%
        \expandafter\@cdr\@Stack\@nil
      }%
    }%
    \typeout{}%
    \typeout{\string#1=#1}%
  \fi
}
\def\@StackEmpty{\BOTTOM}
\let\@Stack\@StackEmpty
\newcommand*{\Stack}[1]{%
  \def\@Stack{#1\BOTTOM}%
}
\AtEndDocument{%
  \begin{qstest}{StackUsed}{StackUsed}%
    \Expect*{%
      \ifx\@Stack\@StackEmpty
      \else
        Error: Unused stack entries%
      \fi
    }{}%
  \end{qstest}%
}
\newcommand*{\CheckInclude}[2]{%
  \include{askinclude-#1}%
  \begin{qstest}{CheckInclude-#1}{CheckInclude-#1}%
    \Expect*{%
      \expandafter\ifx\csname file#1\endcsname Ytrue\else false\fi
    }{#2}%
  \end{qstest}%
}
\def\@EndChecks{}
\AtBeginDocument{%
  \AtEndDocument{%
    \if@filesw
      \immediate\write\@mainaux{\string\@EndChecks}%
    \fi
  }%
}
\newcommand*{\CheckAnswer}[1]{%
  \gdef\AnswerText{#1}%
  \g@addto@macro\@EndChecks{\@CheckAnswer}%
}
\def\@CheckAnswer{%
  \begin{qstest}{CheckAnswer}{CheckAnswer}%
    \Expect*{\unexpanded\expandafter{\AskInc@Answer}}%
           *{\unexpanded\expandafter{\AnswerText}}%
  \end{qstest}%
}
\newcommand*{\CheckMatchMethod}[1]{%
  \gdef\MatchMethodText{#1}%
  \g@addto@macro\@EndChecks{\@CheckMatchMethod}%
}
\def\@CheckMatchMethod{%
  \begin{qstest}{CheckMatchMethod}{CheckMatchMethod}%
    \Expect*{\unexpanded\expandafter{\AskInc@MatchMethod}}%
           *{\unexpanded\expandafter{\MatchMethodText}}%
  \end{qstest}%
}
\def\@CheckAux{%
  \begin{qstest}{CheckAux}{CheckAux}%
    \def\GetFileContents##1{%
      \pdfunescapehex{%
        \pdffiledump length\pdffilesize{##1}{##1}%
      }%
    }%
    \Expect*{\GetFileContents{\jobname.aux}}%
           *{\GetFileContents{\jobname-aux.aux}}%
  \end{qstest}%
}
\g@addto@macro\@EndChecks{\@CheckAux}
\let\org@filec@ntents\filec@ntents
\def\filec@ntents{%
  \catcode`\|=0 %
  \org@filec@ntents
}
\begingroup
  \endlinechar=-1 %
  \catcode`\|=0 %
  \@makeother\#%
  \@makeother\\%
  |gdef|AddList{%
    \providecommand*\AskInc@AddList[2]{%
      \ifcase\ifx#1\@undefined
             \else\ifx#1\relax
             \else\ifx#1\@empty
             \else1\fi\fi\fi0 %
        \gdef#1{#2}%
      \else
        \g@addto@macro#1{,#2}%
      \fi
    }%
  }%
  |gdef|AddFile{%
    \providecommand\AskInc@AddFile{%
      \AskInc@AddList\AskInc@Files
    }%
  }%
  |gdef|AddMatch{%
    \providecommand\AskInc@AddMatch{%
      \AskInc@AddList\AskInc@MatchFiles
    }%
  }%
|endgroup
\Stack{{askinclude-b}}
\CheckAnswer{askinclude-b}
\begin{filecontents*}{\jobname.aux}
\relax
\end{filecontents*}
\begin{filecontents*}{\jobname-aux.aux}
\relax|space
\gdef\AskInc@Answer{askinclude-b}
\gdef\AskInc@MatchMethod{}
|AddList
|AddFile
\AskInc@AddFile{askinclude-a}
\@input{askinclude-a.aux}
\AskInc@AddFile{askinclude-b}
\@input{askinclude-b.aux}
\AskInc@AddFile{askinclude-c}
\@input{askinclude-c.aux}
\@EndChecks
\end{filecontents*}
\begin{document}
\CheckInclude{a}{false}
\CheckInclude{b}{true}
\CheckInclude{c}{false}
\end{document}
\endinput
%%
%% End of file `askinclude-test4.tex'.

Zerion Mini Shell 1.0