]> git.donarmstrong.com Git - perltidy.git/commitdiff
update test for future default change from -neos to -eos
authorSteve Hancock <perltidy@users.sourceforge.net>
Thu, 3 Mar 2022 19:08:52 +0000 (11:08 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Thu, 3 Mar 2022 19:08:52 +0000 (11:08 -0800)
t/testwide.t

index f194d0edff6f0ffd54e185db62090a69715581e9..4a8a1ce5861c86e08199cfa3d9952342339e08a2 100755 (executable)
@@ -30,6 +30,8 @@ EOM
 
 my $output;
 
+# The source is in character mode here, so perltidy will not decode.
+# So here we do not need to set -eos or -neos
 Perl::Tidy::perltidy(
     source      => \$source,
     destination => \$output,
@@ -39,11 +41,15 @@ Perl::Tidy::perltidy(
 
 ok($output, $expected_output);
 
+# Since default encoding is 'guess' and the source is a file of utf8, perltidy
+# will guess utf8 and decode the input. But we are comparing to a string which
+# is in character mode, so we do not want perltidy to encode the output in this
+# case and therefore must set -neos.
 Perl::Tidy::perltidy(
     source      => $FindBin::Bin . '/testwide.pl.src',
     destination => \$output,
     perltidyrc  => \$perltidyrc,
-    argv        => '-nsyn',
+    argv        => '-nsyn -neos',
 );
 
 ok($output, $expected_output);