summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/tests/write18-quote-test.pl
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-01-13 01:18:02 +0000
committerKarl Berry <karl@freefriends.org>2010-01-13 01:18:02 +0000
commit2c3f4ac000585f4d975117d6000cbfd574070fef (patch)
tree4472d9ffb35f46e81df4b31ff5a367e1816dc042 /Build/source/texk/web2c/tests/write18-quote-test.pl
parent8a0ac1c324c5add345d500a13d24dcdb5785d9cb (diff)
start at testing restricted \write18 and quotes, plus factoring out common test functions
git-svn-id: svn://tug.org/texlive/trunk@16695 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/tests/write18-quote-test.pl')
-rwxr-xr-xBuild/source/texk/web2c/tests/write18-quote-test.pl22
1 files changed, 22 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/tests/write18-quote-test.pl b/Build/source/texk/web2c/tests/write18-quote-test.pl
new file mode 100755
index 00000000000..74256516b73
--- /dev/null
+++ b/Build/source/texk/web2c/tests/write18-quote-test.pl
@@ -0,0 +1,22 @@
+#!/usr/bin/env perl
+# $Id$
+# Copyright 2010 Karl Berry <tex-live@tug.org>.
+# You may freely use, modify and/or distribute this file.
+# Check that restricted shell invocation doesn't misquote.
+
+BEGIN { chomp ($srcdir = $ENV{"srcdir"} || `pwd`); }
+require "$srcdir/tests/common-test.pl";
+
+exit (&main ());
+
+sub main
+{
+ $badfile = "write18-quote-newfile.tex";
+ unlink ($badfile); # ensure no leftover from previous test
+
+ my @args = qw(-ini -shell-restricted $srcdir/tests/write18-quote.tex);
+ my $ret = &test_run ("./tex", @args);
+
+ my $bad = -f $badfile; # file should not have been created
+ return $bad;
+}