diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/oberdiek/pdfescape-test1.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/oberdiek/pdfescape-test1.tex | 199 |
1 files changed, 199 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/oberdiek/pdfescape-test1.tex b/Master/texmf-dist/doc/latex/oberdiek/pdfescape-test1.tex new file mode 100644 index 00000000000..d4244df4b69 --- /dev/null +++ b/Master/texmf-dist/doc/latex/oberdiek/pdfescape-test1.tex @@ -0,0 +1,199 @@ +%% +%% This is file `pdfescape-test1.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% pdfescape.dtx (with options: `test1') +%% +%% This is a generated file. +%% +%% Copyright (C) 2007 by Heiko Oberdiek <oberdiek@uni-freiburg.de> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. 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 pdfescape.dtx +%% and the derived files +%% pdfescape.sty, pdfescape.pdf, pdfescape.ins, pdfescape.drv, +%% pdfescape-test1.tex, pdfescape-test2.tex, +%% pdfescape-test3.tex. +%% +\NeedsTeXFormat{LaTeX2e} +\makeatletter +\ProvidesFile{pdfescape-test1.tex}% + [2006/02/25 v1.1 Test with \string\pdfescape... commands] +\@ifundefined{pdfescapehex}{% + \PackageError{pdfescape-test1}{% + Missing \string\pdfescape... commands% + }{Test aborted.}% + \stop +}{} +\RequirePackage{qstest} +\IncludeTests{*} +\LogTests{lgout}{*}{*} + +\newcommand*{\ExpectVar}[2]{% + \Expect*{\ifx#1#2true\else false\fi}{true}% +} + +\makeatletter + +\begingroup + \makeatletter + \gdef\AllBytes{} + \count@=0 + \catcode0=12 % + \@whilenum\count@<256 \do{% + \lccode0=\count@ + \ifnum\count@=32 % + \xdef\AllBytes{\AllBytes\space}% + \else + \lowercase{% + \xdef\AllBytes{\AllBytes^^@}% + }% + \fi + \advance\count@ by 1 % + }% +\endgroup +\newcommand*{\AllBytesHex}{% + 000102030405060708090A0B0C0D0E0F% + 101112131415161718191A1B1C1D1E1F% + 202122232425262728292A2B2C2D2E2F% + 303132333435363738393A3B3C3D3E3F% + 404142434445464748494A4B4C4D4E4F% + 505152535455565758595A5B5C5D5E5F% + 606162636465666768696A6B6C6D6E6F% + 707172737475767778797A7B7C7D7E7F% + 808182838485868788898A8B8C8D8E8F% + 909192939495969798999A9B9C9D9E9F% + A0A1A2A3A4A5A6A7A8A9AAABACADAEAF% + B0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF% + C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF% + D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF% + E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF% + F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF% +} +\@onelevel@sanitize\AllBytesHex +\expandafter\lowercase\expandafter{% + \expandafter\newcommand\expandafter*\expandafter\AllBytesHexLC + \expandafter{\AllBytesHex}% +} +\newcommand*{\AllBytesName}{} +\begingroup + \catcode`\#=12 % + \xdef\AllBytesName{% + #01#02#03#04#05#06#07#08#09#0A#0B#0C#0D#0E#0F% + #10#11#12#13#14#15#16#17#18#19#1A#1B#1C#1D#1E#1F% + #20!"#23$#25&'#28#29*+,-.#2F% + 0123456789:;#3C=#3E?% + @ABCDEFGHIJKLMNO% + PQRSTUVWXYZ#5B\@backslashchar#5D^_% + `abcdefghijklmno% + pqrstuvwxyz#7B|#7D\string~#7F% + #80#81#82#83#84#85#86#87#88#89#8A#8B#8C#8D#8E#8F% + #90#91#92#93#94#95#96#97#98#99#9A#9B#9C#9D#9E#9F% + #A0#A1#A2#A3#A4#A5#A6#A7#A8#A9#AA#AB#AC#AD#AE#AF% + #B0#B1#B2#B3#B4#B5#B6#B7#B8#B9#BA#BB#BC#BD#BE#BF% + #C0#C1#C2#C3#C4#C5#C6#C7#C8#C9#CA#CB#CC#CD#CE#CF% + #D0#D1#D2#D3#D4#D5#D6#D7#D8#D9#DA#DB#DC#DD#DE#DF% + #E0#E1#E2#E3#E4#E5#E6#E7#E8#E9#EA#EB#EC#ED#EE#EF% + #F0#F1#F2#F3#F4#F5#F6#F7#F8#F9#FA#FB#FC#FD#FE#FF% + } +\endgroup +\@onelevel@sanitize\AllBytesName + +\newcommand*{\AllBytesString}{} +\begingroup + \def\|{|} + \edef\%{\@percentchar} + \catcode`\|=0 % + \catcode`\#=12 % + \catcode`\~=12 % + \catcode`\\=12 % + |xdef|AllBytesString{% + \000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017% + \020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037% + \040!"#$|%&'\(\)*+,-./% + 0123456789:;<=>?% + @ABCDEFGHIJKLMNO% + PQRSTUVWXYZ[\\]^_% + `abcdefghijklmno% + pqrstuvwxyz{||}~\177% + \200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217% + \220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237% + \240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257% + \260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277% + \300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317% + \320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337% + \340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357% + \360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377% + } +|endgroup +\@onelevel@sanitize\AllBytesString + +\RequirePackage{pdfescape} + +\begin{qstest}{all-hex}{\AllBytes, escapehex} + \EdefEscapeHex\x{\AllBytes} + \Expect*{\x}*{\AllBytesHex}% + \ExpectVar\x\AllBytesHex +\end{qstest} + +\begin{qstest}{all-unhex}{\AllBytesHex, unescapehex} + \EdefUnescapeHex\x{\AllBytesHex} + \Expect*{\x}*{\AllBytes} + \ExpectVar\x\AllBytes +\end{qstest} + +\begin{qstest}{all-unhex-lc}{\AllBytesHexLC, unescapehex, lowercase} + \EdefUnescapeHex\x{\AllBytesHexLC} + \Expect*{\x}*{\AllBytes} + \ExpectVar\x\AllBytes +\end{qstest} + +\begin{qstest}{unhex-incomplete}{unescapehex, incomplete} + \EdefUnescapeHex\x{4} + \Expect*{\x}{@} +\end{qstest} + +\begin{qstest}{unhex-space}{unescapehex, space} + \EdefUnescapeHex\x{20} + \Expect*{\x}{ } + \ExpectVar\x\space +\end{qstest} + +\begin{qstest}{unhex-spaces}{unescapehex, spaces} + \EdefUnescapeHex\x{204020204120} + \def\y#1{% + \edef\z{#1\string @#1#1\string A#1}% + }\y{ } + \Expect*{\x}*{\z} + \ExpectVar\x\z +\end{qstest} + +\begin{qstest}{all-name}{\AllBytes, escapename} + \EdefEscapeName\x{\AllBytes} + \Expect*{\x}*{\AllBytesName} + \ExpectVar\x\AllBytesName +\end{qstest} + +\begin{qstest}{all-string}{\AllBytes, escapestring} + \EdefEscapeString\x{\AllBytes} + \Expect*{\x}*{\AllBytesString} + \ExpectVar\x\AllBytesString +\end{qstest} + +\stop +\endinput +%% +%% End of file `pdfescape-test1.tex'. |