6 BEGIN {unshift @INC, "./"}
7 BEGIN {plan tests => 3}
12 %pangrams=("Plain","ASCII",
13 "Zwölf große Boxkämpfer jagen Vik quer über den Sylter.","DE",
14 "Jeż wlókł gęś. Uf! Bądź choć przy nim, stań!","PL",
15 "Любя, съешь щипцы, — вздохнёт мэр, — кайф жгуч.","RU");
18 my $expected_output=<<'EOM';
21 "Zwölf große Boxkämpfer jagen Vik quer über den Sylter.", "DE",
22 "Jeż wlókł gęś. Uf! Bądź choć przy nim, stań!", "PL",
23 "Любя, съешь щипцы, — вздохнёт мэр, — кайф жгуч.", "RU"
27 my $perltidyrc = <<'EOM';
35 destination => \$output,
36 perltidyrc => \$perltidyrc,
40 ok($output, $expected_output);
43 source => $FindBin::Bin . '/testwide.pl.src',
44 destination => \$output,
45 perltidyrc => \$perltidyrc,
49 ok($output, $expected_output);
51 # Test writing encoded output to stdout with the -st flag
52 # References: RT #133166, RT #133171, git #35
56 # Send STDOUT to a temporary file
58 my $fh = new File::Temp();
59 my $tmpfile = $fh->filename;
61 # Note that we are not specifying an encoding here. Perltidy should do that.
63 open STDOUT, '>', $tmpfile or die "Can't open tmpfile: $!";
67 ##destination => ... we are using -st, so no destination is specified
68 perltidyrc => \$perltidyrc,
69 argv => '-nsyn -st', # added -st
73 # Read the temporary file back in. Note that here we need to specify
75 open TMP, '<', $tmpfile;
76 binmode TMP, ":raw:encoding(UTF-8)";
77 while ( my $line = <TMP> ) { $output .= $line }
80 ok($output, $expected_output);