aboutsummaryrefslogtreecommitdiffstats
path: root/qpdf/qtest/unicode-filenames.test
blob: 2237b74890b62b804a5891e84c385fc2695b8e6a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env perl
require 5.008;
use warnings;
use strict;

unshift(@INC, '.');
require qpdf_test_helpers;

chdir("qpdf") or die "chdir testdir failed: $!\n";

require TestDriver;

cleanup();

my $td = new TestDriver('unicode-filenames');

my $n_tests = 3;

$td->runtest("create unicode filenames",
             {$td->COMMAND => "test_unicode_filenames"},
             {$td->STRING => "created Unicode filenames\n",
                  $td->EXIT_STATUS => 0},
             $td->NORMALIZE_NEWLINES);

foreach my $d (['auto-ü', 1], ['auto-öπ', 2])
{
    my ($u, $n) = @$d;
    $td->runtest("unicode filename $u",
                 {$td->COMMAND => "qpdf --check $u.pdf"},
                 {$td->FILE => "check-unicode-filename-$n.out",
                      $td->EXIT_STATUS => 0},
                 $td->NORMALIZE_NEWLINES);
}

cleanup();
$td->report($n_tests);