[latex3-commits] [git/LaTeX3-latex3-latex2e] gh220: Add github-0220.luatex.tlg, github-0220.lvt, and github-0220.tlg to verify the filecontents functionality (6cc8d98f)
Johannes Braams
texniek at braams.xs4all.nl
Sat Aug 8 14:09:38 CEST 2020
Repository : https://github.com/latex3/latex2e
On branch : gh220
Link : https://github.com/latex3/latex2e/commit/6cc8d98f3b5f826ee617075f33206db17c058973
>---------------------------------------------------------------
commit 6cc8d98f3b5f826ee617075f33206db17c058973
Author: Johannes Braams <texniek at braams.xs4all.nl>
Date: Sat Aug 8 14:09:38 2020 +0200
Add github-0220.luatex.tlg, github-0220.lvt, and github-0220.tlg to verify the filecontents functionality
>---------------------------------------------------------------
6cc8d98f3b5f826ee617075f33206db17c058973
base/testfiles/github-0220.luatex.tlg | 35 ++++++++++++++++++
base/testfiles/github-0220.lvt | 69 +++++++++++++++++++++++++++++++++++
base/testfiles/github-0220.tlg | 34 +++++++++++++++++
3 files changed, 138 insertions(+)
diff --git a/base/testfiles/github-0220.luatex.tlg b/base/testfiles/github-0220.luatex.tlg
new file mode 100644
index 00000000..ebce203a
--- /dev/null
+++ b/base/testfiles/github-0220.luatex.tlg
@@ -0,0 +1,35 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+Author: Johannes Braams
+Format: LaTeX2e<2020-10-01>
+Main Class: minimal
+Reading the fie ``github 220 input.tex''
+("./github 220 input.tex"
+This is from file ``github 220 input''.
+)
+Writing a file with the same name again, should fail:
+LaTeX Warning: File `github 220 input' already exists on the system.
+ Not generating it from this source.
+Reading the fie ``github 220 input.tex'' (same result)
+("./github 220 input.tex"
+This is from file ``github 220 input''.
+)
+Forcing to writing a file with the same name, should succeed:
+LaTeX Warning: Writing or overwriting file `./github 220 input'.
+\openout127 = github 220 input.tex
+Reading the fie ``github 220 input.tex'' (different result)
+("./github 220 input.tex"
+This is from the third file ``github 220 input''.
+)
+Writing a file called ``h.tex'', should fail:
+LaTeX Warning: File `h.tex' already exists on the system.
+ Not generating it from this source.
+(h.tex
+This should be from a file called ``h.tex''
+)
+Writing a file called ``h.tex'' while only looking in the current dir, should succeed:
+LaTeX Warning: File `./h.tex' already in current directory.
+ Not generating it from this source.
+(h.tex
+This should be from a file called ``h.tex''
+) (github-0220.aux)
diff --git a/base/testfiles/github-0220.lvt b/base/testfiles/github-0220.lvt
new file mode 100644
index 00000000..5790a56f
--- /dev/null
+++ b/base/testfiles/github-0220.lvt
@@ -0,0 +1,69 @@
+%
+% This file is used to prove the functionality of
+% the filecontents environment. It should write the contents of
+% the environment to a file with the name given in the argument.
+% The filename may contain spaces.
+% The option ``noheader'' prevents the first three lines of comments
+% to be written.
+%
+% If a fie with the same name exists, the file is not written uness
+% the optiona argument `force' or `overwrite' is given.
+% Searching for an exosting file can be limited to the current
+% directory by the optional argument `nosearch'.
+% the environment is allowed anywhere in the document, but preferably
+% before \documentclass{}
+
+% Now create a first file
+\begin{filecontents}[force]{github 220 input}
+ \typeout{This is from file ``github 220 input''.}
+\end{filecontents}
+\documentclass{minimal}
+
+\input{test2e}
+\START
+\AUTHOR{Johannes Braams}
+\FORMAT{LaTeX2e<2020-10-01>}
+\CLASS{minimal}
+
+\OMIT
+\begin{document}
+\TIMO
+\typeout{Reading the fie ``github 220 input.tex''}
+\input{github 220 input}
+
+\typeout{Writing a file with the same name again, should fail:}
+% Writing the file again should fail:
+\begin{filecontents}{github 220 input}
+ \typeout{This is from the second file ``github 220 input''.}
+\end{filecontents}
+\typeout{Reading the fie ``github 220 input.tex'' (same result)}
+\input{github 220 input}
+
+% unless forced:
+
+\typeout{Forcing to writing a file with the same name, should succeed:}
+\begin{filecontents}[overwrite]{github 220 input}
+ \typeout{This is from the third file ``github 220 input''.}
+\end{filecontents}
+\typeout{Reading the fie ``github 220 input.tex'' (different result)}
+\input{github 220 input}
+
+% Now try it for a file that exists somewhere in the texmf search
+% tree:
+
+\typeout{Writing a file called ``h.tex'', should fail:}
+\begin{filecontents}{h.tex}
+ \typeout{This should be from a file called ``h.tex''}
+\end{filecontents}
+\input{h.tex}
+
+
+\typeout{Writing a file called ``h.tex'' while only looking in
+ the current dir, should succeed:}
+
+\begin{filecontents}[nosearch,noheader]{h.tex}
+ \typeout{This should be from a file called ``h.tex''}
+\end{filecontents}
+\input{h.tex}
+
+\end{document}
diff --git a/base/testfiles/github-0220.tlg b/base/testfiles/github-0220.tlg
new file mode 100644
index 00000000..b1f90e19
--- /dev/null
+++ b/base/testfiles/github-0220.tlg
@@ -0,0 +1,34 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+Author: Johannes Braams
+Format: LaTeX2e<2020-10-01>
+Main Class: minimal
+Reading the fie ``github 220 input.tex''
+(github 220 input.tex
+This is from file ``github 220 input''.
+)
+Writing a file with the same name again, should fail:
+LaTeX Warning: File `github 220 input' already exists on the system.
+ Not generating it from this source.
+Reading the fie ``github 220 input.tex'' (same result)
+(github 220 input.tex
+This is from file ``github 220 input''.
+)
+Forcing to writing a file with the same name, should succeed:
+LaTeX Warning: Writing or overwriting file `./github 220 input'.
+Reading the fie ``github 220 input.tex'' (different result)
+(github 220 input.tex
+This is from the third file ``github 220 input''.
+)
+Writing a file called ``h.tex'', should fail:
+LaTeX Warning: File `h.tex' already exists on the system.
+ Not generating it from this source.
+(h.tex
+This should be from a file called ``h.tex''
+)
+Writing a file called ``h.tex'' while only looking in the current dir, should succeed:
+LaTeX Warning: File `./h.tex' already in current directory.
+ Not generating it from this source.
+(h.tex
+This should be from a file called ``h.tex''
+) (github-0220.aux)
More information about the latex3-commits
mailing list.