summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/tests
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-03-08 18:49:47 +0000
committerKarl Berry <karl@freefriends.org>2010-03-08 18:49:47 +0000
commit39314b5c03d8cbc0fd25b4cc665df2090d75defe (patch)
tree9ea4ea2c6ef3a8376fcc52947b0fb0db2dedd970 /Build/source/texk/web2c/tests
parent933606e1f19552101ffc0e2ddb0126253601efee (diff)
add longline test for bibtex 0.99d
git-svn-id: svn://tug.org/texlive/trunk@17384 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/tests')
-rwxr-xr-xBuild/source/texk/web2c/tests/bibtex-longline-test.pl38
-rwxr-xr-xBuild/source/texk/web2c/tests/bibtex-openout-test.pl7
2 files changed, 42 insertions, 3 deletions
diff --git a/Build/source/texk/web2c/tests/bibtex-longline-test.pl b/Build/source/texk/web2c/tests/bibtex-longline-test.pl
new file mode 100755
index 00000000000..d800be2ef93
--- /dev/null
+++ b/Build/source/texk/web2c/tests/bibtex-longline-test.pl
@@ -0,0 +1,38 @@
+#!/usr/bin/env perl
+# $Id: bibtex-openout-test.pl 17085 2010-02-18 18:03:18Z karl $
+# Public domain. Originally written 2010, Karl Berry.
+# Check that bibtex does not break long strings (change in 2010).
+
+# srcdir = web2c (in the source tree)
+BEGIN { chomp ($srcdir = $ENV{"srcdir"} || `cd \`dirname $0\`/.. && pwd`); }
+require "$srcdir/../tests/common-test.pl";
+
+exit (&main ());
+
+sub main
+{
+ # The blg and bbl file names are based on the aux name and cannot be
+ # overridden. We can't write to the aux (source) directory, though,
+ # because that's an absolute path and openout_any=p. Therefore, copy
+ # the input files to our working directory.
+ for my $ext ("aux", "bib") {
+ &test_file_copy ("$srcdir/tests/longline.$ext", "./longline.$ext");
+ }
+
+ # Run BibTeX, quit if it fails.
+ my $ret = &test_run ("./bibtex", "./longline.aux");
+ return 1 if $ret != 0;
+
+ # There should be lines longer than 80 chars in the output.
+ # (In older versions of BibTeX, they are forcibly split, with a %.)
+ local *IN;
+ $IN = "longline.bbl";
+ open (IN) || die "open($IN) failed: $!";
+ while (<IN>) {
+ last if length ($_) >= 80;
+ }
+
+ # We failed if all lines were < 80.
+ my $bad = ! (length $_ >= 80);
+ return $bad;
+}
diff --git a/Build/source/texk/web2c/tests/bibtex-openout-test.pl b/Build/source/texk/web2c/tests/bibtex-openout-test.pl
index 45fd92d1b6f..cc00564e5d3 100755
--- a/Build/source/texk/web2c/tests/bibtex-openout-test.pl
+++ b/Build/source/texk/web2c/tests/bibtex-openout-test.pl
@@ -3,7 +3,8 @@
# Public domain. Originally written 2010, Karl Berry.
# Check that bibtex respects openout_any.
-BEGIN { chomp ($srcdir = $ENV{"srcdir"} || `dirname $0`); }
+# srcdir = web2c (in the source tree)
+BEGIN { chomp ($srcdir = $ENV{"srcdir"} || `cd \`dirname $0\`/.. && pwd`); }
require "$srcdir/../tests/common-test.pl";
exit (&main ());
@@ -12,10 +13,10 @@ sub main
{
$ENV{"openout_any"} = "p"; # should already be in texmf.cnf, but ...
- # .blg open of abs path should fail
+ # .blg open of abs path should fail:
my $ret = &test_run ("./bibtex", "$srcdir/exampl.aux");
- # The test fails if the program succeeded. Ideally we'd grep the output.
+ # The test fails if the program succeeded. Could also check the output.
my $bad = ($ret == 0);
return $bad;
}