]> git.donarmstrong.com Git - perltidy.git/commitdiff
reactivate skipped tests
authorSteve Hancock <perltidy@users.sourceforge.net>
Sat, 19 Feb 2022 01:43:09 +0000 (17:43 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sat, 19 Feb 2022 01:43:09 +0000 (17:43 -0800)
lib/Perl/Tidy.pod
t/testwide-passthrough.t [new file with mode: 0644]
t/testwide-passthrough.t.SKIP [deleted file]
t/testwide-tidy.t [new file with mode: 0644]
t/testwide-tidy.t.SKIP [deleted file]

index 0423b7e1ed1597518d8b9b7ff3857e0cf091b0cf..42e0bf064964597bf7c17999654edb1cd4f97bb7 100644 (file)
@@ -89,7 +89,7 @@ of two possible states, decoded or encoded, and it is important that the
 calling program and Perl::Tidy are in agreement regarding the state to be
 returned.  A flag B<--encode-output-strings>, or simply B<-eos>, was added in
 versions of Perl::Tidy after 20220101 for this purpose. This flag should be
-added to the end of the B<argv> paremeter (described below) if Perl::Tidy
+added to the end of the B<argv> parameter (described below) if Perl::Tidy
 will be decoding utf8 text.  The options are as follows.
 
 =over 4
diff --git a/t/testwide-passthrough.t b/t/testwide-passthrough.t
new file mode 100644 (file)
index 0000000..6a00600
--- /dev/null
@@ -0,0 +1,130 @@
+use strict;
+use warnings;
+use utf8;
+
+use FindBin qw($Bin);
+use File::Temp qw(tempfile);
+use Test::More;
+
+BEGIN { unshift @INC, "./" }
+use Perl::Tidy;
+
+# This tests the -eos (--encode-output-strings) which was added for issue
+# git #83 to fix an issue with tidyall.
+
+# NOTE: to prevent automatic conversion of line endings LF to CRLF under github
+# Actions with Windows, which would cause test failure, it is essential that
+# there be a file 't/.gitattributes' with the line:
+# * -text
+
+# The test file has no tidying needs but is UTF-8 encoded, so all passes
+# through perltidy should read/write identical contents (previously only
+# file test behaved correctly)
+
+plan( tests => 6 );
+
+test_all();
+
+sub test_all {
+    my $test_file = "$Bin/testwide-passthrough.pl.src";
+    test_file2file($test_file);
+    test_scalar2scalar($test_file);
+    test_scalararray2scalararray($test_file);
+}
+
+sub test_file2file {
+    my $test_file = shift;
+
+    my $tmp_file = File::Temp->new( TMPDIR => 1 );
+
+    my $source      = $test_file;
+    my $destination = $tmp_file->filename();
+
+    note("Testing file2file: '$source' => '$destination'\n");
+
+    my $tidyresult = Perl::Tidy::perltidy(
+        argv        => '-utf8',
+        source      => $source,
+        destination => $destination
+    );
+    ok( !$tidyresult, 'perltidy' );
+
+    my $source_str      = slurp_raw($source);
+    my $destination_str = slurp_raw($destination);
+
+    my $source_hex      = unpack( 'H*', $source_str );
+    my $destination_hex = unpack( 'H*', $destination_str );
+    note("Comparing contents:\n  $source_hex\n  $destination_hex\n");
+
+    ok( $source_hex eq $destination_hex, 'file content compare' );
+}
+
+sub test_scalar2scalar {
+    my $testfile = shift;
+
+    my $source = slurp_raw($testfile);
+    my $destination;
+
+    note("Testing scalar2scalar\n");
+
+    my $tidyresult = Perl::Tidy::perltidy(
+        argv        => '-utf8 -eos',
+        source      => \$source,
+        destination => \$destination
+    );
+    ok( !$tidyresult, 'perltidy' );
+
+    my $source_hex      = unpack( 'H*', $source );
+    my $destination_hex = unpack( 'H*', $destination );
+
+    note("Comparing contents:\n  $source_hex\n  $destination_hex\n");
+    ok( $source_hex eq $destination_hex, 'scalar content compare' );
+}
+
+sub test_scalararray2scalararray {
+    my $testfile = shift;
+
+    my $source      = [ lines_raw($testfile) ];
+    my $destination = [];
+
+    note("Testing scalararray2scalararray\n");
+
+    my $tidyresult = Perl::Tidy::perltidy(
+        argv        => '-utf8 -eos',
+        source      => $source,
+        destination => $destination
+    );
+    ok( !$tidyresult, 'perltidy' );
+
+    my $source_str      = join( "", @$source );
+    my $destination_str = join( "", @$destination );
+
+    my $source_hex      = unpack( 'H*', $source_str );
+    my $destination_hex = unpack( 'H*', $destination_str );
+
+    note("Comparing contents:\n  $source_hex\n  $destination_hex\n");
+    ok( $source_hex eq $destination_hex, 'scalararray content compare' );
+}
+
+sub slurp_raw {
+    my $filename = shift;
+
+    open( TMP, '<', $filename );
+    binmode( TMP, ':raw' );
+    local $/;
+    my $contents = <TMP>;
+    close(TMP);
+
+    return $contents;
+}
+
+sub lines_raw {
+    my $filename = shift;
+
+    open( TMP, '<', $filename );
+    binmode( TMP, ':raw' );
+    my @contents = <TMP>;
+    close(TMP);
+
+    return @contents;
+}
diff --git a/t/testwide-passthrough.t.SKIP b/t/testwide-passthrough.t.SKIP
deleted file mode 100644 (file)
index 6a00600..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-use strict;
-use warnings;
-use utf8;
-
-use FindBin qw($Bin);
-use File::Temp qw(tempfile);
-use Test::More;
-
-BEGIN { unshift @INC, "./" }
-use Perl::Tidy;
-
-# This tests the -eos (--encode-output-strings) which was added for issue
-# git #83 to fix an issue with tidyall.
-
-# NOTE: to prevent automatic conversion of line endings LF to CRLF under github
-# Actions with Windows, which would cause test failure, it is essential that
-# there be a file 't/.gitattributes' with the line:
-# * -text
-
-# The test file has no tidying needs but is UTF-8 encoded, so all passes
-# through perltidy should read/write identical contents (previously only
-# file test behaved correctly)
-
-plan( tests => 6 );
-
-test_all();
-
-sub test_all {
-    my $test_file = "$Bin/testwide-passthrough.pl.src";
-    test_file2file($test_file);
-    test_scalar2scalar($test_file);
-    test_scalararray2scalararray($test_file);
-}
-
-sub test_file2file {
-    my $test_file = shift;
-
-    my $tmp_file = File::Temp->new( TMPDIR => 1 );
-
-    my $source      = $test_file;
-    my $destination = $tmp_file->filename();
-
-    note("Testing file2file: '$source' => '$destination'\n");
-
-    my $tidyresult = Perl::Tidy::perltidy(
-        argv        => '-utf8',
-        source      => $source,
-        destination => $destination
-    );
-    ok( !$tidyresult, 'perltidy' );
-
-    my $source_str      = slurp_raw($source);
-    my $destination_str = slurp_raw($destination);
-
-    my $source_hex      = unpack( 'H*', $source_str );
-    my $destination_hex = unpack( 'H*', $destination_str );
-    note("Comparing contents:\n  $source_hex\n  $destination_hex\n");
-
-    ok( $source_hex eq $destination_hex, 'file content compare' );
-}
-
-sub test_scalar2scalar {
-    my $testfile = shift;
-
-    my $source = slurp_raw($testfile);
-    my $destination;
-
-    note("Testing scalar2scalar\n");
-
-    my $tidyresult = Perl::Tidy::perltidy(
-        argv        => '-utf8 -eos',
-        source      => \$source,
-        destination => \$destination
-    );
-    ok( !$tidyresult, 'perltidy' );
-
-    my $source_hex      = unpack( 'H*', $source );
-    my $destination_hex = unpack( 'H*', $destination );
-
-    note("Comparing contents:\n  $source_hex\n  $destination_hex\n");
-    ok( $source_hex eq $destination_hex, 'scalar content compare' );
-}
-
-sub test_scalararray2scalararray {
-    my $testfile = shift;
-
-    my $source      = [ lines_raw($testfile) ];
-    my $destination = [];
-
-    note("Testing scalararray2scalararray\n");
-
-    my $tidyresult = Perl::Tidy::perltidy(
-        argv        => '-utf8 -eos',
-        source      => $source,
-        destination => $destination
-    );
-    ok( !$tidyresult, 'perltidy' );
-
-    my $source_str      = join( "", @$source );
-    my $destination_str = join( "", @$destination );
-
-    my $source_hex      = unpack( 'H*', $source_str );
-    my $destination_hex = unpack( 'H*', $destination_str );
-
-    note("Comparing contents:\n  $source_hex\n  $destination_hex\n");
-    ok( $source_hex eq $destination_hex, 'scalararray content compare' );
-}
-
-sub slurp_raw {
-    my $filename = shift;
-
-    open( TMP, '<', $filename );
-    binmode( TMP, ':raw' );
-    local $/;
-    my $contents = <TMP>;
-    close(TMP);
-
-    return $contents;
-}
-
-sub lines_raw {
-    my $filename = shift;
-
-    open( TMP, '<', $filename );
-    binmode( TMP, ':raw' );
-    my @contents = <TMP>;
-    close(TMP);
-
-    return @contents;
-}
diff --git a/t/testwide-tidy.t b/t/testwide-tidy.t
new file mode 100644 (file)
index 0000000..723d088
--- /dev/null
@@ -0,0 +1,131 @@
+use strict;
+use warnings;
+use utf8;
+
+use FindBin qw($Bin);
+use File::Temp qw(tempfile);
+use Test::More;
+
+BEGIN { unshift @INC, "./" }
+use Perl::Tidy;
+
+# This tests the -eos (--encode-output-strings) which was added for issue
+# git #83 to fix an issue with tidyall.
+
+# NOTE: to prevent automatic conversion of line endings LF to CRLF under github
+# Actions with Windows, which would cause test failure, it is essential that
+# there be a file 't/.gitattributes' with the line:
+# * -text
+
+# The test file is UTF-8 encoded
+
+plan( tests => 6 );
+
+test_all();
+
+sub test_all {
+    my $test_file = "$Bin/testwide-tidy.pl.src";
+    my $tidy_file = "$Bin/testwide-tidy.pl.srctdy";
+    my $tidy_str  = slurp_raw($tidy_file);
+    test_file2file( $test_file, $tidy_str );
+    test_scalar2scalar( $test_file, $tidy_str );
+    test_scalararray2scalararray( $test_file, $tidy_str );
+}
+
+sub test_file2file {
+    my $test_file = shift;
+    my $tidy_str  = shift;
+    my $tidy_hex  = unpack( 'H*', $tidy_str );
+
+    my $tmp_file = File::Temp->new( TMPDIR => 1 );
+
+    my $source      = $test_file;
+    my $destination = $tmp_file->filename();
+
+    note("Testing file2file: '$source' => '$destination'\n");
+
+    my $tidyresult = Perl::Tidy::perltidy(
+        argv        => '-utf8',
+        source      => $source,
+        destination => $destination
+    );
+    ok( !$tidyresult, 'perltidy' );
+
+    my $destination_str = slurp_raw($destination);
+    my $destination_hex = unpack( 'H*', $destination_str );
+
+    note("Comparing contents:\n  $tidy_hex\n  $destination_hex\n");
+    ok($tidy_hex eq $destination_hex, 'file content compare');
+
+}
+
+sub test_scalar2scalar {
+    my $test_file = shift;
+    my $tidy_str  = shift;
+    my $tidy_hex  = unpack( 'H*', $tidy_str );
+
+    my $source = slurp_raw($test_file);
+    my $destination;
+
+    note("Testing scalar2scalar\n");
+
+    my $tidyresult = Perl::Tidy::perltidy(
+        argv        => '-utf8 -eos',
+        source      => \$source,
+        destination => \$destination
+    );
+    ok( !$tidyresult, 'perltidy' );
+
+    my $destination_hex = unpack( 'H*', $destination );
+
+    note("Comparing contents:\n  $tidy_hex\n  $destination_hex\n");
+    ok($tidy_hex eq $destination_hex, 'scalar content compare');
+
+}
+
+sub test_scalararray2scalararray {
+    my $test_file = shift;
+    my $tidy_str  = shift;
+    my $tidy_hex  = unpack( 'H*', $tidy_str );
+
+    my $source      = [ lines_raw($test_file) ];
+    my $destination = [];
+
+    note("Testing scalararray2scalararray\n");
+
+    my $tidyresult = Perl::Tidy::perltidy(
+        argv        => '-utf8 -eos',
+        source      => $source,
+        destination => $destination
+    );
+    ok( !$tidyresult, 'perltidy' );
+
+    my $destination_str = join( '', @$destination );
+    my $destination_hex = unpack( 'H*', $destination_str );
+
+    note("Comparing contents:\n  $tidy_hex\n  $destination_hex\n");
+    ok($tidy_hex eq $destination_hex, 'scalararray content compare');
+}
+
+sub slurp_raw {
+    my $filename = shift;
+
+    open( TMP, '<', $filename );
+    binmode( TMP, ':raw' );
+    local $/;
+    my $contents = <TMP>;
+    close(TMP);
+
+    return $contents;
+}
+
+sub lines_raw {
+    my $filename = shift;
+
+    open( TMP, '<', $filename );
+    binmode( TMP, ':raw' );
+    my @contents = <TMP>;
+    close(TMP);
+
+    return @contents;
+}
diff --git a/t/testwide-tidy.t.SKIP b/t/testwide-tidy.t.SKIP
deleted file mode 100644 (file)
index 723d088..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-use strict;
-use warnings;
-use utf8;
-
-use FindBin qw($Bin);
-use File::Temp qw(tempfile);
-use Test::More;
-
-BEGIN { unshift @INC, "./" }
-use Perl::Tidy;
-
-# This tests the -eos (--encode-output-strings) which was added for issue
-# git #83 to fix an issue with tidyall.
-
-# NOTE: to prevent automatic conversion of line endings LF to CRLF under github
-# Actions with Windows, which would cause test failure, it is essential that
-# there be a file 't/.gitattributes' with the line:
-# * -text
-
-# The test file is UTF-8 encoded
-
-plan( tests => 6 );
-
-test_all();
-
-sub test_all {
-    my $test_file = "$Bin/testwide-tidy.pl.src";
-    my $tidy_file = "$Bin/testwide-tidy.pl.srctdy";
-    my $tidy_str  = slurp_raw($tidy_file);
-    test_file2file( $test_file, $tidy_str );
-    test_scalar2scalar( $test_file, $tidy_str );
-    test_scalararray2scalararray( $test_file, $tidy_str );
-}
-
-sub test_file2file {
-    my $test_file = shift;
-    my $tidy_str  = shift;
-    my $tidy_hex  = unpack( 'H*', $tidy_str );
-
-    my $tmp_file = File::Temp->new( TMPDIR => 1 );
-
-    my $source      = $test_file;
-    my $destination = $tmp_file->filename();
-
-    note("Testing file2file: '$source' => '$destination'\n");
-
-    my $tidyresult = Perl::Tidy::perltidy(
-        argv        => '-utf8',
-        source      => $source,
-        destination => $destination
-    );
-    ok( !$tidyresult, 'perltidy' );
-
-    my $destination_str = slurp_raw($destination);
-    my $destination_hex = unpack( 'H*', $destination_str );
-
-    note("Comparing contents:\n  $tidy_hex\n  $destination_hex\n");
-    ok($tidy_hex eq $destination_hex, 'file content compare');
-
-}
-
-sub test_scalar2scalar {
-    my $test_file = shift;
-    my $tidy_str  = shift;
-    my $tidy_hex  = unpack( 'H*', $tidy_str );
-
-    my $source = slurp_raw($test_file);
-    my $destination;
-
-    note("Testing scalar2scalar\n");
-
-    my $tidyresult = Perl::Tidy::perltidy(
-        argv        => '-utf8 -eos',
-        source      => \$source,
-        destination => \$destination
-    );
-    ok( !$tidyresult, 'perltidy' );
-
-    my $destination_hex = unpack( 'H*', $destination );
-
-    note("Comparing contents:\n  $tidy_hex\n  $destination_hex\n");
-    ok($tidy_hex eq $destination_hex, 'scalar content compare');
-
-}
-
-sub test_scalararray2scalararray {
-    my $test_file = shift;
-    my $tidy_str  = shift;
-    my $tidy_hex  = unpack( 'H*', $tidy_str );
-
-    my $source      = [ lines_raw($test_file) ];
-    my $destination = [];
-
-    note("Testing scalararray2scalararray\n");
-
-    my $tidyresult = Perl::Tidy::perltidy(
-        argv        => '-utf8 -eos',
-        source      => $source,
-        destination => $destination
-    );
-    ok( !$tidyresult, 'perltidy' );
-
-    my $destination_str = join( '', @$destination );
-    my $destination_hex = unpack( 'H*', $destination_str );
-
-    note("Comparing contents:\n  $tidy_hex\n  $destination_hex\n");
-    ok($tidy_hex eq $destination_hex, 'scalararray content compare');
-}
-
-sub slurp_raw {
-    my $filename = shift;
-
-    open( TMP, '<', $filename );
-    binmode( TMP, ':raw' );
-    local $/;
-    my $contents = <TMP>;
-    close(TMP);
-
-    return $contents;
-}
-
-sub lines_raw {
-    my $filename = shift;
-
-    open( TMP, '<', $filename );
-    binmode( TMP, ':raw' );
-    my @contents = <TMP>;
-    close(TMP);
-
-    return @contents;
-}