~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to tests/pr/pr-tests.pl

  • Committer: Colin Watson
  • Date: 2013-10-30 15:48:33 UTC
  • mfrom: (8.3.5 sid)
  • Revision ID: cjwatson@canonical.com-20131030154833-xdt6e1yfffqom1c4
merge from Debian 8.21-1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/perl
2
2
# Test pr.
3
3
 
4
 
# Copyright (C) 2008-2012 Free Software Foundation, Inc.
 
4
# Copyright (C) 2008-2013 Free Software Foundation, Inc.
5
5
 
6
6
# This program is free software: you can redistribute it and/or modify
7
7
# it under the terms of the GNU General Public License as published by
407
407
# Before coreutils-8.13 page numbers were not handled correctly when
408
408
# headers were not printed (when -l <= 10 or -t or -T specified)
409
409
['page-range', '+1:1 -2 -l1 -s" "',  "a\nb\nc\n", "a b\n", 0],
 
410
 
 
411
# This padded with zeros before coreutils-8.21
 
412
['padding1', '-t -n,15', "1\n", (" "x 14)."1,1\n", 0],
 
413
# This crashed with divide by zero before coreutils-8.21
 
414
['padding2', '-t -n,64', "1\n", (" "x 63)."1,1\n", 0],
 
415
# Ensure we handle buffer truncation correctly
 
416
['padding3', '-t -N1000000 -n,1', "1\n", "0,1\n", 0],
410
417
);
411
418
 
412
419
# Convert the above old-style test vectors to the newer
451
458
    push @Tests, $new_ent;
452
459
  }
453
460
 
 
461
# Exercise a bug with pr -m -s (commit 553d347)
 
462
push @Tests,
 
463
   ['merge-w-tabs', '-m -s -t',
 
464
    {IN=>{1=>"a\tb\tc\n"}},
 
465
    {IN=>{2=>"m\tn\to\n"}},
 
466
    {IN=>{3=>"x\ty\tz\n"}},
 
467
     {OUT=>join("\t", qw(a b c m n o x y z)) . "\n"} ];
 
468
 
454
469
@Tests = triple_test \@Tests;
455
470
 
456
471
my $save_temps = $ENV{DEBUG};