Commits

Martin Scharrer committed a212cad

Added test files.

Comments (0)

Files changed (18)

test/FilemodCmp.tex

+\documentclass{article}
+
+\usepackage{filemod}
+
+\newcounter{tests}
+\newcounter{fail}
+\newcounter{success}
+
+\AtEndDocument{%
+    \par\bigskip\noindent
+    Results:\\
+    \tabular{ll}%
+    Tests:     & \arabic{tests}   \\
+    Succeeded: & \arabic{success}    \\
+    Failed:    & \arabic{fail} \\
+    \endtabular
+    \let~\space
+    \message{^^J%
+    Results:^^J%
+    Tests:~~~~~\arabic{tests}   ^^J%
+    Succeeded:~\arabic{success}    ^^J%
+    Failed:~~~~\arabic{fail} ^^J%
+    }%
+    \par
+}
+
+\def\test#1#2#3{%
+  \def\TESTSTR{#1}%
+  #1\relax
+  \edef\TEST{\filemodcmpresult#2}%
+  \edef\TARGET{#3}%
+  \stepcounter{tests}%
+  \par\bigskip
+  \par\noindent
+  \message{^^J%
+    \meaning\TESTSTR^^J%
+    \meaning\TEST^^J%
+    \ifx\TEST\TARGET
+        SUCCESS!%
+    \else
+        FAIL: \meaning\TARGET
+    \fi
+  ^^J}%
+  \ifx\TEST\TARGET
+    \stepcounter{success}%
+  \else
+    \stepcounter{fail}%
+  \fi
+  \meaning\TEST\\
+  \TEST
+}
+
+\begin{document}
+\begingroup
+\ttfamily
+
+
+
+\test{\FilemodCmp{filea}{fileb}}{{A}{B}{C}}{B{C}}
+\test{\FilemodCmp[-1]{filea}{fileb}}{{A}{B}{C}}{B{C}}
+\test{\FilemodCmp[0]{filea}{fileb}}{{A}{B}{C}}{B{C}}
+\test{\FilemodCmp[1]{filea}{fileb}}{{A}{B}{C}}{B{C}}
+\test{\FilemodCmp[2]{filea}{fileb}}{{A}{B}{C}}{B{C}}
+\test{\FilemodCmp[3]{filea}{fileb}}{{A}{B}{C}}{B}
+\test{\FilemodCmp[4]{filea}{fileb}}{{A}{B}{C}}{B}
+
+\test{\FilemodCmp{fileb}{filea}}{{B}{A}{C}}{B{C}}
+\test{\FilemodCmp[-1]{fileb}{filea}}{{B}{A}{C}}{B{C}}
+\test{\FilemodCmp[0]{fileb}{filea}}{{B}{A}{C}}{B{C}}
+\test{\FilemodCmp[1]{fileb}{filea}}{{B}{A}{C}}{B{C}}
+\test{\FilemodCmp[2]{fileb}{filea}}{{B}{A}{C}}{B{C}}
+\test{\FilemodCmp[3]{fileb}{filea}}{{B}{A}{C}}{B}
+\test{\FilemodCmp[4]{fileb}{filea}}{{B}{A}{C}}{B}
+
+\test{\FilemodCmp{filea}{filea}}{{A}{B}{C}}{A{C}}
+\test{\FilemodCmp[-1]{filea}{filea}}{{A}{B}{C}}{C}
+\test{\FilemodCmp[0]{filea}{filea}}{{A}{B}{C}}{{C}}
+\test{\FilemodCmp[1]{filea}{filea}}{{A}{B}{C}}{A{C}}
+\test{\FilemodCmp[2]{filea}{filea}}{{A}{B}{C}}{B{C}}
+\test{\FilemodCmp[3]{filea}{filea}}{{A}{B}{C}}{C}
+\test{\FilemodCmp[4]{filea}{filea}}{{A}{B}{C}}{C}
+
+\endgroup
+\end{document}
+

test/FilemodNewest.tex

+\documentclass{article}
+
+\usepackage{filemod}
+
+\newcounter{tests}
+\newcounter{fail}
+\newcounter{success}
+
+\AtEndDocument{%
+    \par\bigskip\noindent
+    Results:\\
+    \tabular{ll}%
+    Tests:     & \arabic{tests}   \\
+    Succeeded: & \arabic{success}    \\
+    Failed:    & \arabic{fail} \\
+    \endtabular
+    \let~\space
+    \message{^^J%
+    Results:^^J%
+    Tests:~~~~~\arabic{tests}   ^^J%
+    Succeeded:~\arabic{success}    ^^J%
+    Failed:~~~~\arabic{fail} ^^J%
+    }%
+    \par
+}
+
+\makeatletter
+\def\test#1#2{%
+  \def\TESTSTR{#1}%
+  #1\relax
+  \edef\TEST{\filemodresultfile}%
+  \edef\TARGET{#2}%
+  \@onelevel@sanitize\TEST
+  \@onelevel@sanitize\TARGET
+  \stepcounter{tests}%
+  \par\bigskip
+  \par\noindent
+  \message{^^J%
+    \meaning\TESTSTR^^J%
+    \meaning\TEST^^J%
+    \ifx\TEST\TARGET
+        SUCCESS!%
+    \else
+        FAIL: \meaning\TARGET
+    \fi
+  ^^J}%
+  \ifx\TEST\TARGET
+    \stepcounter{success}%
+  \else
+    \stepcounter{fail}%
+  \fi
+  \meaning\TEST\\
+  \TEST
+}
+\makeatother
+
+\begin{document}
+\begingroup
+\ttfamily
+
+
+\test{\FilemodNewest{{file1}{file2}{file3}{file4}{file5}{file6}}}{file6}%
+\test{\FilemodNewest{{file3}{file2}{file5}{file4}{file1}{file6}}}{file6}%
+\test{\FilemodNewest[1]{{file1}{file2}{file3}{file4}{file5}{file6}}}{file6}%
+\test{\FilemodNewest[1]{{file3}{file2}{file5}{file4}{file1}{file6}}}{file6}%
+\test{\FilemodNewest[2]{{file1}{file2}{file3}{file4}{file5}{file6}}}{file6}%
+\test{\FilemodNewest[2]{{file3}{file2}{file5}{file4}{file1}{file6}}}{file6}%
+\test{\FilemodOldest{{file1}{file2}{file3}{file4}{file5}{file6}}}{file1}%
+\test{\FilemodOldest{{file3}{file2}{file5}{file4}{file1}{file6}}}{file1}%
+\test{\FilemodOldest[1]{{file1}{file2}{file3}{file4}{file5}{file6}}}{file1}%
+\test{\FilemodOldest[1]{{file3}{file2}{file5}{file4}{file1}{file6}}}{file1}%
+\test{\FilemodOldest[2]{{file1}{file2}{file3}{file4}{file5}{file6}}}{file1}%
+\test{\FilemodOldest[2]{{file3}{file2}{file5}{file4}{file1}{file6}}}{file1}%
+
+
+\endgroup
+\end{document}
+

test/Filemodcmp.tex

+%&pdflatex
+\documentclass{article}
+
+\usepackage{filemod}
+
+\begin{document}
+\begingroup
+\ttfamily
+
+\def\test#1{%
+  \def\TESTSTR{#1}%
+  \edef\TEST{#1}%
+  \par\bigskip
+  \par\noindent
+  \message{^^J%
+  \meaning\TESTSTR^^J%
+  \meaning\TEST
+  ^^J}%
+  \meaning\TEST\\
+  \TEST
+}
+
+\test{\filemodcmp{filea}{fileb}{A}{B}}
+
+\test{\filemodCmp{filea}{fileb}{A}{B}{C}}
+\test{\filemodCmp[-1]{filea}{fileb}{A}{B}{C}}
+\test{\filemodCmp[0]{filea}{fileb}{A}{B}{C}}
+\test{\filemodCmp[1]{filea}{fileb}{A}{B}{C}}
+\test{\filemodCmp[2]{filea}{fileb}{A}{B}{C}}
+\test{\filemodCmp[3]{filea}{fileb}{A}{B}{C}}
+\test{\filemodCmp[4]{filea}{fileb}{A}{B}{C}}
+
+\test{\filemodCmp{fileb}{filea}{A}{B}{C}}
+\test{\filemodCmp[-1]{fileb}{filea}{A}{B}{C}}
+\test{\filemodCmp[0]{fileb}{filea}{A}{B}{C}}
+\test{\filemodCmp[1]{fileb}{filea}{A}{B}{C}}
+\test{\filemodCmp[2]{fileb}{filea}{A}{B}{C}}
+\test{\filemodCmp[3]{fileb}{filea}{A}{B}{C}}
+\test{\filemodCmp[4]{fileb}{filea}{A}{B}{C}}
+
+\test{\filemodCmp{filea}{filea}{A}{B}{C}}
+\test{\filemodCmp[-1]{filea}{filea}{A}{B}{C}}
+\test{\filemodCmp[0]{filea}{filea}{A}{B}{C}}
+\test{\filemodCmp[1]{filea}{filea}{A}{B}{C}}
+\test{\filemodCmp[2]{filea}{filea}{A}{B}{C}}
+\test{\filemodCmp[3]{filea}{filea}{A}{B}{C}}
+\test{\filemodCmp[4]{filea}{filea}{A}{B}{C}}
+
+\endgroup
+\end{document}
+

test/Filemodnewest.tex

+\documentclass{article}
+
+\usepackage{filemod}
+
+\newcounter{tests}
+\newcounter{fail}
+\newcounter{success}
+
+\AtEndDocument{%
+    \par\bigskip\noindent
+    Results:\\
+    \tabular{ll}%
+    Tests:     & \arabic{tests}   \\
+    Succeeded: & \arabic{success}    \\
+    Failed:    & \arabic{fail} \\
+    \endtabular
+    \let~\space
+    \message{^^J%
+    Results:^^J%
+    Tests:~~~~~\arabic{tests}   ^^J%
+    Succeeded:~\arabic{success}    ^^J%
+    Failed:~~~~\arabic{fail} ^^J%
+    }%
+    \par
+}
+
+\makeatletter
+\def\test#1#2{%
+  \def\TESTSTR{#1}%
+  #1\relax
+  \edef\TEST{\filemodresultfile}%
+  \edef\TARGET{#2}%
+  \@onelevel@sanitize\TEST
+  \@onelevel@sanitize\TARGET
+  \stepcounter{tests}%
+  \par\bigskip
+  \par\noindent
+  \message{^^J%
+    \meaning\TESTSTR^^J%
+    \meaning\TEST^^J%
+    \ifx\TEST\TARGET
+        SUCCESS!%
+    \else
+        FAIL: \meaning\TARGET
+    \fi
+  ^^J}%
+  \ifx\TEST\TARGET
+    \stepcounter{success}%
+  \else
+    \stepcounter{fail}%
+  \fi
+  \meaning\TEST\\
+  \TEST
+}
+\makeatother
+
+\begin{document}
+\begingroup
+\ttfamily
+
+
+\def\FILEA{filea}
+\def\FILEB{fileb}
+\test {\Filemodnewest{filea}{fileb}}{fileb}
+\test {\Filemodnewest\FILEA{fileb}}{fileb}
+\test {\Filemodnewest{filea}\FILEB}{fileb}
+\test {\Filemodnewest\FILEA\FILEB}{fileb}
+\test {\Filemodnewest{[filea}{fileb}}{fileb}
+%\test {\Filemodnewest{[}{filea}{fileb}}{fileb}
+
+
+\test {\Filemodnewest[1]{filea}{fileb}}{fileb}
+\test {\Filemodnewest[1]\FILEA{fileb}}{fileb}
+\test {\Filemodnewest[1]{filea}\FILEB}{fileb}
+\test {\Filemodnewest[1]\FILEA\FILEB}{fileb}
+
+\test {\Filemodnewest[2]{filea}{fileb}}{fileb}
+\test {\Filemodnewest[2]\FILEA{fileb}}{fileb}
+\test {\Filemodnewest[2]{filea}\FILEB}{fileb}
+\test {\Filemodnewest[2]\FILEA\FILEB}{fileb}
+
+\test {\Filemodnewest[1]{filea}{fileA}}{filea}
+\test {\Filemodnewest[1]\FILEA{fileA}}{filea}
+\test {\Filemodnewest[1]{fileA}\FILEA}{fileA}
+\test {\Filemodnewest[1]\FILEA\FILEA}{filea}
+
+\test {\Filemodnewest[2]{filea}{fileA}}{fileA}
+\test {\Filemodnewest[2]\FILEA{fileA}}{fileA}
+\test {\Filemodnewest[2]{fileA}\FILEA}{filea}
+\test {\Filemodnewest[2]\FILEA\FILEA}{filea}
+
+\test {\Filemodoldest{filea}{fileb}}{filea}
+\test {\Filemodoldest\FILEA{fileb}}{filea}
+\test {\Filemodoldest{filea}\FILEB}{filea}
+\test {\Filemodoldest\FILEA\FILEB}{filea}
+
+
+\endgroup
+\end{document}
+

test/chapter1/chap1.tex

+\chapter{Eins}
+
+\Filemodtoday{\currfilepath}
+

test/chapter2/chap2.tex

+\chapter{Zwei}
+
+\Filemodtoday{\currfilepath}
+

test/chapter3/chap3.tex

+\chapter{Drei}
+
+\Filemodtoday{\currfilepath}
+

test/filemodCmp-tex.tex

+
+\input filemod-expmin
+
+\def\test#1#2{%
+  \def\TESTSTR{#1}%
+  \edef\TEST{#1}%
+  \edef\TARGET{#2}%
+  \par\bigskip
+  \par\noindent
+  \message{^^J%
+    \meaning\TESTSTR^^J%
+    \meaning\TEST^^J%
+    \ifx\TEST\TARGET
+        SUCCESS!%
+    \else
+        FAIL: \meaning\TARGET
+    \fi
+  ^^J}%
+  \par
+  \meaning\TEST\par
+  \TEST
+}
+
+
+\begingroup
+%
+\test{\filemodCmp{filea}{fileb}{a}{b}}{b}
+\test{\filemodCmp{fileb}{filea}{b}{a}}{b}
+\test{\filemodCmp{filea}{notthere}{a}{not}}{a}
+\test{\filemodCmp{notthere}{filea}{not}{a}}{a}
+\test{\filemodCmp{nottherea}{notthereb}{nota}{notb}}{nota}
+\test{\filemodCmp{notthereb}{nottherea}{notb}{nota}}{notb}
+%
+\test{\filemodCmp{filea.tex}{fileb.tex}{a}{b}}{b}
+\test{\filemodCmp{fileb.tex}{filea.tex}{b}{a}}{b}
+\test{\filemodCmp{filea.tex}{notthere.tex}{a}{not}}{a}
+\test{\filemodCmp{notthere.tex}{filea.tex}{not}{a}}{a}
+\test{\filemodCmp{nottherea.tex}{notthereb.tex}{nota}{notb}}{nota}
+\test{\filemodCmp{notthereb.tex}{nottherea.tex}{notb}{nota}}{notb}
+%
+\test{\filemodCmp{filea.tex}{fileb}{a}{b}}{b}
+\test{\filemodCmp{fileb.tex}{filea}{b}{a}}{b}
+\test{\filemodCmp{filea.tex}{notthere}{a}{not}}{a}
+\test{\filemodCmp{notthere.tex}{filea}{not}{a}}{a}
+\test{\filemodCmp{nottherea.tex}{notthereb}{nota}{notb}}{nota}
+\test{\filemodCmp{notthereb.tex}{nottherea}{notb}{nota}}{notb}
+%
+\test{\filemodCmp{filea}{fileb.tex}{a}{b}}{b}
+\test{\filemodCmp{fileb}{filea.tex}{b}{a}}{b}
+\test{\filemodCmp{filea}{notthere.tex}{a}{not}}{a}
+\test{\filemodCmp{notthere}{filea.tex}{not}{a}}{a}
+\test{\filemodCmp{nottherea}{notthereb.tex}{nota}{notb}}{nota}
+\test{\filemodCmp{notthereb}{nottherea.tex}{notb}{nota}}{notb}
+%
+\test{\filemodCmp{filea.txt}{fileb.tex}{a}{b}}{b}
+\test{\filemodCmp{fileb.txt}{filea.tex}{b}{a}}{b}
+\test{\filemodCmp{filea.txt}{notthere.tex}{a}{not}}{a}
+\test{\filemodCmp{notthere.txt}{filea.tex}{not}{a}}{a}
+\test{\filemodCmp{nottherea.txt}{notthereb.tex}{nota}{notb}}{nota}
+\test{\filemodCmp{notthereb.txt}{nottherea.tex}{notb}{nota}}{notb}
+%
+\test{\filemodCmp{filea.tex}{fileb.txt}{a}{b}}{b}
+\test{\filemodCmp{fileb.tex}{filea.txt}{b}{a}}{b}
+\test{\filemodCmp{filea.tex}{notthere.txt}{a}{not}}{a}
+\test{\filemodCmp{notthere.tex}{filea.txt}{not}{a}}{a}
+\test{\filemodCmp{nottherea.tex}{notthereb.txt}{nota}{notb}}{nota}
+\test{\filemodCmp{notthereb.tex}{nottherea.txt}{notb}{nota}}{notb}
+%
+\test{\filemodCmp{filea.txt}{fileb.txt}{a}{b}}{b}
+\test{\filemodCmp{fileb.txt}{filea.txt}{b}{a}}{b}
+\test{\filemodCmp{filea.txt}{notthere.txt}{a}{not}}{a}
+\test{\filemodCmp{notthere.txt}{filea.txt}{not}{a}}{a}
+\test{\filemodCmp{nottherea.txt}{notthereb.txt}{nota}{notb}}{nota}
+\test{\filemodCmp{notthereb.txt}{nottherea.txt}{notb}{nota}}{notb}
+%
+\test{\filemodCmp{filea.txt}{fileb}{a}{b}}{b}
+\test{\filemodCmp{fileb.txt}{filea}{b}{a}}{b}
+\test{\filemodCmp{filea.txt}{notthere}{a}{not}}{a}
+\test{\filemodCmp{notthere.txt}{filea}{not}{a}}{a}
+\test{\filemodCmp{nottherea.txt}{notthereb}{nota}{notb}}{nota}
+\test{\filemodCmp{notthereb.txt}{nottherea}{notb}{nota}}{notb}
+%
+\test{\filemodCmp{filea}{fileb.txt}{a}{b}}{b}
+\test{\filemodCmp{fileb}{filea.txt}{b}{a}}{b}
+\test{\filemodCmp{filea}{notthere.txt}{a}{not}}{a}
+\test{\filemodCmp{notthere}{filea.txt}{not}{a}}{a}
+\test{\filemodCmp{nottherea}{notthereb.txt}{nota}{notb}}{nota}
+\test{\filemodCmp{notthereb}{nottherea.txt}{notb}{nota}}{notb}
+%
+\endgroup
+%
+\bye

test/filemodCmp.tex

+\documentclass{article}
+
+\usepackage{filemod-expmin}
+
+\newcounter{tests}
+\newcounter{fail}
+\newcounter{success}
+
+\AtEndDocument{%
+    \par\bigskip\noindent
+    Results:\\
+    \tabular{ll}%
+    Tests:     & \arabic{tests}   \\
+    Succeeded: & \arabic{success}    \\
+    Failed:    & \arabic{fail} \\
+    \endtabular
+    \let~\space
+    \message{^^J%
+    Results:^^J%
+    Tests:~~~~~\arabic{tests}   ^^J%
+    Succeeded:~\arabic{success}    ^^J%
+    Failed:~~~~\arabic{fail} ^^J%
+    }%
+    \par
+}
+
+\def\test#1#2{%
+  \def\TESTSTR{#1}%
+  \edef\TEST{#1}%
+  \edef\TARGET{#2}%
+  \stepcounter{tests}%
+  \par\bigskip
+  \par\noindent
+  \message{^^J%
+    \meaning\TESTSTR^^J%
+    \meaning\TEST^^J%
+    \ifx\TEST\TARGET
+        SUCCESS!%
+    \else
+        FAIL: \meaning\TARGET
+    \fi
+  ^^J}%
+  \ifx\TEST\TARGET
+    \stepcounter{success}%
+  \else
+    \stepcounter{fail}%
+  \fi
+  \meaning\TEST\\
+  \TEST
+}
+
+
+\begin{document}
+\begingroup
+\ttfamily
+
+\test{\filemodCmp{filea}{fileb}{a}{b}}{b}
+\test{\filemodCmp{fileb}{filea}{b}{a}}{b}
+\test{\filemodCmp{filea}{notthere}{a}{not}}{a}
+\test{\filemodCmp{notthere}{filea}{not}{a}}{a}
+\test{\filemodCmp{nottherea}{notthereb}{nota}{notb}}{nota}
+\test{\filemodCmp{notthereb}{nottherea}{notb}{nota}}{notb}
+
+\test{\filemodCmp{filea.tex}{fileb.tex}{a}{b}}{b}
+\test{\filemodCmp{fileb.tex}{filea.tex}{b}{a}}{b}
+\test{\filemodCmp{filea.tex}{notthere.tex}{a}{not}}{a}
+\test{\filemodCmp{notthere.tex}{filea.tex}{not}{a}}{a}
+\test{\filemodCmp{nottherea.tex}{notthereb.tex}{nota}{notb}}{nota}
+\test{\filemodCmp{notthereb.tex}{nottherea.tex}{notb}{nota}}{notb}
+
+\test{\filemodCmp{filea.tex}{fileb}{a}{b}}{b}
+\test{\filemodCmp{fileb.tex}{filea}{b}{a}}{b}
+\test{\filemodCmp{filea.tex}{notthere}{a}{not}}{a}
+\test{\filemodCmp{notthere.tex}{filea}{not}{a}}{a}
+\test{\filemodCmp{nottherea.tex}{notthereb}{nota}{notb}}{nota}
+\test{\filemodCmp{notthereb.tex}{nottherea}{notb}{nota}}{notb}
+
+\test{\filemodCmp{filea}{fileb.tex}{a}{b}}{b}
+\test{\filemodCmp{fileb}{filea.tex}{b}{a}}{b}
+\test{\filemodCmp{filea}{notthere.tex}{a}{not}}{a}
+\test{\filemodCmp{notthere}{filea.tex}{not}{a}}{a}
+\test{\filemodCmp{nottherea}{notthereb.tex}{nota}{notb}}{nota}
+\test{\filemodCmp{notthereb}{nottherea.tex}{notb}{nota}}{notb}
+
+
+\test{\filemodCmp{filea.txt}{fileb.tex}{a}{b}}{b}
+\test{\filemodCmp{fileb.txt}{filea.tex}{b}{a}}{b}
+\test{\filemodCmp{filea.txt}{notthere.tex}{a}{not}}{a}
+\test{\filemodCmp{notthere.txt}{filea.tex}{not}{a}}{a}
+\test{\filemodCmp{nottherea.txt}{notthereb.tex}{nota}{notb}}{nota}
+\test{\filemodCmp{notthereb.txt}{nottherea.tex}{notb}{nota}}{notb}
+
+\test{\filemodCmp{filea.tex}{fileb.txt}{a}{b}}{b}
+\test{\filemodCmp{fileb.tex}{filea.txt}{b}{a}}{b}
+\test{\filemodCmp{filea.tex}{notthere.txt}{a}{not}}{a}
+\test{\filemodCmp{notthere.tex}{filea.txt}{not}{a}}{a}
+\test{\filemodCmp{nottherea.tex}{notthereb.txt}{nota}{notb}}{nota}
+\test{\filemodCmp{notthereb.tex}{nottherea.txt}{notb}{nota}}{notb}
+
+\test{\filemodCmp{filea.txt}{fileb.txt}{a}{b}}{b}
+\test{\filemodCmp{fileb.txt}{filea.txt}{b}{a}}{b}
+\test{\filemodCmp{filea.txt}{notthere.txt}{a}{not}}{a}
+\test{\filemodCmp{notthere.txt}{filea.txt}{not}{a}}{a}
+\test{\filemodCmp{nottherea.txt}{notthereb.txt}{nota}{notb}}{nota}
+\test{\filemodCmp{notthereb.txt}{nottherea.txt}{notb}{nota}}{notb}
+
+\test{\filemodCmp{filea.txt}{fileb}{a}{b}}{b}
+\test{\filemodCmp{fileb.txt}{filea}{b}{a}}{b}
+\test{\filemodCmp{filea.txt}{notthere}{a}{not}}{a}
+\test{\filemodCmp{notthere.txt}{filea}{not}{a}}{a}
+\test{\filemodCmp{nottherea.txt}{notthereb}{nota}{notb}}{nota}
+\test{\filemodCmp{notthereb.txt}{nottherea}{notb}{nota}}{notb}
+
+\test{\filemodCmp{filea}{fileb.txt}{a}{b}}{b}
+\test{\filemodCmp{fileb}{filea.txt}{b}{a}}{b}
+\test{\filemodCmp{filea}{notthere.txt}{a}{not}}{a}
+\test{\filemodCmp{notthere}{filea.txt}{not}{a}}{a}
+\test{\filemodCmp{nottherea}{notthereb.txt}{nota}{notb}}{nota}
+\test{\filemodCmp{notthereb}{nottherea.txt}{notb}{nota}}{notb}
+
+\endgroup
+\end{document}
+

test/filemodcmp.tex

+\documentclass{article}
+
+\usepackage{filemod}
+
+\newcounter{tests}
+\newcounter{fail}
+\newcounter{success}
+
+\AtEndDocument{%
+    \par\bigskip\noindent
+    Results:\\
+    \tabular{ll}%
+    Tests:     & \arabic{tests}   \\
+    Succeeded: & \arabic{success}    \\
+    Failed:    & \arabic{fail} \\
+    \endtabular
+    \let~\space
+    \message{^^J%
+    Results:^^J%
+    Tests:~~~~~\arabic{tests}   ^^J%
+    Succeeded:~\arabic{success}    ^^J%
+    Failed:~~~~\arabic{fail} ^^J%
+    }%
+    \par
+}
+
+\def\test#1#2{%
+  \def\TESTSTR{#1}%
+  \edef\TEST{#1}%
+  \edef\TARGET{#2}%
+  \stepcounter{tests}%
+  \par\bigskip
+  \par\noindent
+  \message{^^J%
+    \meaning\TESTSTR^^J%
+    \meaning\TEST^^J%
+    \ifx\TEST\TARGET
+        SUCCESS!%
+    \else
+        FAIL: \meaning\TARGET
+    \fi
+  ^^J}%
+  \ifx\TEST\TARGET
+    \stepcounter{success}%
+  \else
+    \stepcounter{fail}%
+  \fi
+  \meaning\TEST\\
+  \TEST
+}
+
+\begin{document}
+\begingroup
+\ttfamily
+
+
+\test{\filemodCmp{filea}{fileb}{A}{B}}{B}
+
+\test{\filemodcmp{filea}{fileb}{A}{B}{C}}{B{C}}
+\test{\filemodcmp[-1]{filea}{fileb}{A}{B}{C}}{B{C}}
+\test{\filemodcmp[0]{filea}{fileb}{A}{B}{C}}{B{C}}
+\test{\filemodcmp[1]{filea}{fileb}{A}{B}{C}}{B{C}}
+\test{\filemodcmp[2]{filea}{fileb}{A}{B}{C}}{B{C}}
+\test{\filemodcmp[3]{filea}{fileb}{A}{B}{C}}{B}
+\test{\filemodcmp[4]{filea}{fileb}{A}{B}{C}}{B}
+
+\test{\filemodcmp{fileb}{filea}{B}{A}{C}}{B{C}}
+\test{\filemodcmp[-1]{fileb}{filea}{B}{A}{C}}{B{C}}
+\test{\filemodcmp[0]{fileb}{filea}{B}{A}{C}}{B{C}}
+\test{\filemodcmp[1]{fileb}{filea}{B}{A}{C}}{B{C}}
+\test{\filemodcmp[2]{fileb}{filea}{B}{A}{C}}{B{C}}
+\test{\filemodcmp[3]{fileb}{filea}{B}{A}{C}}{B}
+\test{\filemodcmp[4]{fileb}{filea}{B}{A}{C}}{B}
+
+\test{\filemodcmp{filea}{filea}{A}{B}{C}}{A{C}}
+\test{\filemodcmp[-1]{filea}{filea}{A}{B}{C}}{C}
+\test{\filemodcmp[0]{filea}{filea}{A}{B}{C}}{{C}}
+\test{\filemodcmp[1]{filea}{filea}{A}{B}{C}}{A{C}}
+\test{\filemodcmp[2]{filea}{filea}{A}{B}{C}}{B{C}}
+\test{\filemodcmp[3]{filea}{filea}{A}{B}{C}}{C}
+\test{\filemodcmp[4]{filea}{filea}{A}{B}{C}}{C}
+
+\endgroup
+\end{document}
+

test/filemodestbm1.tex

+\documentclass{article}
+
+\usepackage{filemod}
+
+\begin{document}
+\begingroup
+\ttfamily
+
+\def\test#1{%
+  #1%
+  \def\TESTSTR{#1}%
+  \par\bigskip
+  \par\noindent
+  \message{^^J%
+  \meaning\TESTSTR^^J%
+  \meaning\filemodcmpfile
+  ^^J}%
+}
+
+
+\edef\FILES{%
+{file0}%
+{file1}%
+{file2}%
+{file3}%
+{file4}%
+{file5}%
+{file6}%
+{file7}%
+{file8}%
+{file9}%
+{file10}%
+{file11}%
+{file12}%
+{file13}%
+{file14}%
+{file15}%
+{file16}%
+{file17}%
+{file18}%
+{file19}%
+{file20}%
+{file21}%
+{file22}%
+{file23}%
+{file24}%
+{file25}%
+{file26}%
+{file27}%
+{file28}%
+{file29}%
+{file30}%
+{file31}%
+{file32}%
+{file33}%
+{file34}%
+{file35}%
+{file36}%
+{file37}%
+{file38}%
+{file39}%
+{file40}%
+{file41}%
+{file42}%
+{file43}%
+{file44}%
+{file45}%
+{file46}%
+{file47}%
+{file48}%
+{file49}%
+{file50}%
+{file51}%
+{file52}%
+{file53}%
+{file54}%
+{file55}%
+{file56}%
+{file57}%
+{file58}%
+{file59}%
+{file60}%
+{file61}%
+{file62}%
+{file63}%
+{file64}%
+{file65}%
+{file66}%
+{file67}%
+{file68}%
+{file69}%
+{file70}%
+{file71}%
+{file72}%
+{file73}%
+{file74}%
+{file75}%
+{file76}%
+{file77}%
+{file78}%
+{file79}%
+{file80}%
+{file81}%
+{file82}%
+{file83}%
+{file84}%
+{file85}%
+{file86}%
+{file87}%
+{file88}%
+{file89}%
+{file90}%
+{file91}%
+{file92}%
+{file93}%
+{file94}%
+{file95}%
+{file96}%
+{file97}%
+{file98}%
+{file99}%
+}%
+
+
+\message{^^J}
+
+\newwrite\mywrite
+\immediate\openout\mywrite=\jobname.dat\relax
+
+\def\writedat{\immediate\write\mywrite}
+
+\newcount\mycount
+\newcount\myfact
+\myfact=100\relax
+\loop\ifnum\mycount<20
+
+\expandafter\pdfresettimer
+\expandafter\FilemodNewest\expandafter{\FILES}%
+\edef\A{\the\pdfelapsedtime}
+\writedat{ \the\pdfelapsedtime}
+
+\expandafter\pdfresettimer
+\expandafter\filemodNewest\expandafter{\FILES}
+\edef\B{\the\pdfelapsedtime}
+
+\expandafter\pdfresettimer
+\expandafter\FilemodOldest\expandafter{\FILES}%
+\edef\C{\the\pdfelapsedtime}
+
+\expandafter\pdfresettimer
+\expandafter\filemodOldest\expandafter{\FILES}
+\edef\D{\the\pdfelapsedtime}
+
+\typeout{\the\myfact\space\A\space\B\space\C\space\D}
+\writedat{\the\myfact\space\A\space\B\space\C\space\D}
+
+\edef\FILES{\FILES \FILES}
+
+\multiply\myfact by 2\relax
+\advance\mycount by 1\relax
+\repeat
+
+\endgroup
+\end{document}
+

test/filemodestbm2.tex

+\documentclass{article}
+
+\usepackage{filemod}
+
+\begin{document}
+\begingroup
+\ttfamily
+
+\def\test#1{%
+  #1%
+  \def\TESTSTR{#1}%
+  \par\bigskip
+  \par\noindent
+  \message{^^J%
+  \meaning\TESTSTR^^J%
+  \meaning\filemodcmpfile
+  ^^J}%
+}
+
+\edef\FILES{%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+{file0}%
+}%
+
+\message{^^J}
+
+\newwrite\mywrite
+\immediate\openout\mywrite=\jobname.dat\relax
+
+\def\writedat{\immediate\write\mywrite}
+
+\newcount\mycount
+\newcount\myfact
+\myfact=100\relax
+\loop\ifnum\mycount<20
+
+\expandafter\pdfresettimer
+\expandafter\FilemodNewest\expandafter{\FILES}%
+\edef\A{\the\pdfelapsedtime}
+\writedat{ \the\pdfelapsedtime}
+
+\expandafter\pdfresettimer
+\expandafter\filemodNewest\expandafter{\FILES}
+\edef\B{\the\pdfelapsedtime}
+
+\expandafter\pdfresettimer
+\expandafter\FilemodOldest\expandafter{\FILES}%
+\edef\C{\the\pdfelapsedtime}
+
+\expandafter\pdfresettimer
+\expandafter\filemodOldest\expandafter{\FILES}
+\edef\D{\the\pdfelapsedtime}
+
+\typeout{\the\myfact\space\A\space\B\space\C\space\D}
+\writedat{\the\myfact\space\A\space\B\space\C\space\D}
+
+\edef\FILES{\FILES \FILES}
+
+\multiply\myfact by 2\relax
+\advance\mycount by 1\relax
+\repeat
+
+\endgroup
+\end{document}
+

test/filemodnewest.tex

+\documentclass{article}
+
+\usepackage{filemod}
+
+\newcounter{tests}
+\newcounter{fail}
+\newcounter{success}
+
+\AtEndDocument{%
+    \par\bigskip\noindent
+    Results:\\
+    \tabular{ll}%
+    Tests:     & \arabic{tests}   \\
+    Succeeded: & \arabic{success}    \\
+    Failed:    & \arabic{fail} \\
+    \endtabular
+    \let~\space
+    \message{^^J%
+    Results:^^J%
+    Tests:~~~~~\arabic{tests}   ^^J%
+    Succeeded:~\arabic{success}    ^^J%
+    Failed:~~~~\arabic{fail} ^^J%
+    }%
+    \par
+}
+
+\makeatletter
+\def\test#1#2{%
+  \def\TESTSTR{#1}%
+  \edef\TEST{#1}%
+  \edef\TARGET{#2}%
+  \@onelevel@sanitize\TEST
+  \@onelevel@sanitize\TARGET
+  \stepcounter{tests}%
+  \par\bigskip
+  \par\noindent
+  \message{^^J%
+    \meaning\TESTSTR^^J%
+    \meaning\TEST^^J%
+    \ifx\TEST\TARGET
+        SUCCESS!%
+    \else
+        FAIL: \meaning\TARGET
+    \fi
+  ^^J}%
+  \ifx\TEST\TARGET
+    \stepcounter{success}%
+  \else
+    \stepcounter{fail}%
+  \fi
+  \meaning\TEST\\
+  \TEST
+}
+\makeatother
+
+\begin{document}
+\begingroup
+\ttfamily
+
+\test{\filemodNewest{{00a}{00b}{00c}}}{00c}
+\test{\filemodNewest{{file1}{file2}{file3}{file4}{file5}{file6}}}{file6}%
+\test{\filemodNewest{{file3}{file2}{file5}{file4}{file1}{file6}}}{file6}%
+\test{\filemodNewest[1]{{file1}{file2}{file3}{file4}{file5}{file6}}}{file6}%
+\test{\filemodNewest[1]{{file3}{file2}{file5}{file4}{file1}{file6}}}{file6}%
+\test{\filemodNewest[2]{{file1}{file2}{file3}{file4}{file5}{file6}}}{file6}%
+\test{\filemodNewest[2]{{file3}{file2}{file5}{file4}{file1}{file6}}}{file6}%
+\test{\filemodOldest{{file1}{file2}{file3}{file4}{file5}{file6}}}{file1}%
+\test{\filemodOldest{{file3}{file2}{file5}{file4}{file1}{file6}}}{file1}%
+\test{\filemodOldest[1]{{file1}{file2}{file3}{file4}{file5}{file6}}}{file1}%
+\test{\filemodOldest[1]{{file3}{file2}{file5}{file4}{file1}{file6}}}{file1}%
+\test{\filemodOldest[2]{{file1}{file2}{file3}{file4}{file5}{file6}}}{file1}%
+\test{\filemodOldest[2]{{file3}{file2}{file5}{file4}{file1}{file6}}}{file1}%
+
+
+\def\FILEA{filea}
+\def\FILEB{fileb}
+\test {\filemodnewest{filea}{fileb}}{fileb}
+\test {\filemodnewest\FILEA{fileb}}{fileb}
+\test {\filemodnewest{filea}\FILEB}{fileb}
+\test {\filemodnewest\FILEA\FILEB}{fileb}
+\test {\filemodnewest{[filea}{fileb}}{fileb}
+%\test {\filemodnewest{[}{filea}{fileb}}{fileb}
+
+
+\test {\filemodnewest[1]{filea}{fileb}}{fileb}
+\test {\filemodnewest[1]\FILEA{fileb}}{fileb}
+\test {\filemodnewest[1]{filea}\FILEB}{fileb}
+\test {\filemodnewest[1]\FILEA\FILEB}{fileb}
+
+\test {\filemodnewest[2]{filea}{fileb}}{fileb}
+\test {\filemodnewest[2]\FILEA{fileb}}{fileb}
+\test {\filemodnewest[2]{filea}\FILEB}{fileb}
+\test {\filemodnewest[2]\FILEA\FILEB}{fileb}
+
+\test {\filemodnewest[1]{filea}{fileA}}{filea}
+\test {\filemodnewest[1]\FILEA{fileA}}{filea}
+\test {\filemodnewest[1]{fileA}\FILEA}{fileA}
+\test {\filemodnewest[1]\FILEA\FILEA}{filea}
+
+\test {\filemodnewest[2]{filea}{fileA}}{fileA}
+\test {\filemodnewest[2]\FILEA{fileA}}{fileA}
+\test {\filemodnewest[2]{fileA}\FILEA}{filea}
+\test {\filemodnewest[2]\FILEA\FILEA}{filea}
+
+\test {\filemodoldest{filea}{fileb}}{filea}
+\test {\filemodoldest\FILEA{fileb}}{filea}
+\test {\filemodoldest{filea}\FILEB}{filea}
+\test {\filemodoldest\FILEA\FILEB}{filea}
+
+
+\endgroup
+\end{document}
+

test/filemodnums.tex

+\documentclass{article}
+
+\usepackage{filemod}
+
+\begin{document}
+\ttfamily
+
+\def\test#1{%
+  \def\TESTSTR{#1}%
+  \edef\TEST{#1}%
+  \par\bigskip
+  \par\noindent
+  \message{^^J%
+  \meaning\TESTSTR^^J%
+  \meaning\TEST
+  ^^J}%
+  \meaning\TEST\\
+  \TEST
+}
+
+\begingroup
+%\tracingall
+
+\test{\filemodNumdate{\jobname}}
+\test{\filemodNumtime{\jobname}}
+\test{\filemodnumdate{\jobname}}
+\test{\filemodnumtime{\jobname}}
+
+\Filemodgetnum{\jobname}
+\filemoddate
+\filemodtime
+
+\ifnum\filemodNumdate{\jobname}=\filemodnumdate{\jobname}\relax
+    \typeout{SUCCESS: Numdate=numdate}%
+\else
+    \typeout{FAIL: Numdate<>numdate}%
+\fi
+\ifnum\filemodNumtime{\jobname}=\filemodnumtime{\jobname}\relax
+    \typeout{SUCCESS: Numtime=numtime}%
+\else
+    \typeout{FAIL: Numtime<>numtime}%
+\fi
+\ifnum\filemodNumdate{\jobname}=\filemoddate\relax
+    \typeout{SUCCESS: Numdate=date}%
+\else
+    \typeout{FAIL: Numdate<>date}%
+\fi
+\ifnum\filemodNumtime{\jobname}=\filemodtime\relax
+    \typeout{SUCCESS: Numtime=time}%
+\else
+    \typeout{FAIL: Numtime<>time}%
+\fi
+\ifnum\filemodnumdate{\jobname}=\filemoddate\relax
+    \typeout{SUCCESS: numdate=date}%
+\else
+    \typeout{FAIL: numdate<>date}%
+\fi
+\ifnum\filemodnumtime{\jobname}=\filemodtime\relax
+    \typeout{SUCCESS: numtime=time}%
+\else
+    \typeout{FAIL: numtime<>time}%
+\fi
+
+\endgroup
+\end{document}
+

test/filemodparse.tex

+\documentclass{article}
+
+\usepackage{filemod}
+
+\begin{document}
+\ttfamily
+\def\dateonly#1#2#3#4#5#6#7{#1#2#3}
+
+
+\def\test#1{%
+  \def\TESTSTR{#1}%
+  \edef\TEST{#1}%
+  \par\bigskip
+  \par\noindent
+  \message{^^J%
+  \meaning\TESTSTR^^J%
+  \meaning\TEST
+  ^^J}%
+  \meaning\TEST\\
+  \TEST
+}
+
+\test{\filemodparse{}{\jobname}}
+
+\test{\filemodparse\dateonly{/dev/null}}
+
+\test{\filemodnumdate{/dev/null}}
+
+
+
+\end{document}
+
+%&pdflatex
+\documentclass{article}
+
+\usepackage{filemod}
+\usepackage[german]{datetime}
+
+\begin{document}
+\begingroup
+\filemodcmp[3]{filea}{fileb}
+{first}{second}{neither}
+
+\Filemodcmp[3]{filea}{fileb}
+\message{^^J^^J\filemodcmpresult{first}{second}{neither}^^J}
+
+\renewcommand*\filemodhandledate[3]{\formatdate{#3}{#2}{#1} -- }
+\renewcommand*\filemodhandletime[4]{\formattime{#1}{#2}{#3}}
+
+\filemodparse{filea}
+\endgroup
+\end{document}
+
+

test/inputpathtest.tex

+\documentclass{book}
+
+\usepackage{currfile}[2011/09/18]
+\usepackage{filemod}[2011/09/19]
+\usepackage{import}
+
+\listfiles
+\begin{document}
+
+\includefrom{chapter1/}{chap1}
+\includefrom{chapter2/}{chap2}
+\includefrom{chapter3/}{chap3}
+
+\end{document}
+

test/todaytest.tex

+\documentclass{article}
+
+\usepackage[ngerman]{babel}
+\usepackage{filemod}
+
+\begin{document}
+
+
+\Filemodtoday{\jobname.tex}
+
+\FilemodToday{\jobname.tex}
+
+\today
+
+\end{document}
+