diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2010-04-23 13:07:21 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2010-04-23 13:07:21 +0000 |
commit | d64e27494d29684b840753c87fc3e8a5b6ec3694 (patch) | |
tree | d111d1c03bf74ddb42039b778e338787ba176ee5 /Build/source/texk/web2c/ptexdir/pbibtex-longline-test.pl | |
parent | 57c7d41397ed1ec0e244316a88a33bd2b0324ec1 (diff) |
more pTeX fixes
git-svn-id: svn://tug.org/texlive/trunk@17974 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/ptexdir/pbibtex-longline-test.pl')
-rwxr-xr-x | Build/source/texk/web2c/ptexdir/pbibtex-longline-test.pl | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/ptexdir/pbibtex-longline-test.pl b/Build/source/texk/web2c/ptexdir/pbibtex-longline-test.pl new file mode 100755 index 00000000000..a7db4dadea6 --- /dev/null +++ b/Build/source/texk/web2c/ptexdir/pbibtex-longline-test.pl @@ -0,0 +1,38 @@ +#!/usr/bin/env perl +# $Id: pbibtex-openout-test.pl 17085 2010-02-18 18:03:18Z karl $ +# Public domain. Originally written 2010, Karl Berry. +# Check that pbibtex 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 pBibTeX, quit if it fails. + my $ret = &test_run ("./pbibtex", "./longline.aux"); + return 1 if $ret != 0; + + # There should be lines longer than 80 chars in the output. + # (In older versions of pBibTeX, 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; +} |