]> git.donarmstrong.com Git - perltidy.git/commitdiff
added test snippets for recent code updates
authorSteve Hancock <perltidy@users.sourceforge.net>
Wed, 9 Jan 2019 00:56:43 +0000 (16:56 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Wed, 9 Jan 2019 00:56:43 +0000 (16:56 -0800)
15 files changed:
t/snippets/expect/gnu5.def [new file with mode: 0644]
t/snippets/expect/gnu5.gnu [new file with mode: 0644]
t/snippets/expect/kgb_tight.def [new file with mode: 0644]
t/snippets/expect/wn2.wn
t/snippets/expect/wn5.wn
t/snippets/expect/wngnu1.def [new file with mode: 0644]
t/snippets/gnu5.in [new file with mode: 0644]
t/snippets/kgb_tight.def [new file with mode: 0644]
t/snippets/kgb_tight.in [new file with mode: 0644]
t/snippets/packing_list.txt
t/snippets/wngnu1.in [new file with mode: 0644]
t/snippets/wngun.par [new file with mode: 0644]
t/snippets12.t
t/snippets14.t
t/snippets15.t [new file with mode: 0644]

diff --git a/t/snippets/expect/gnu5.def b/t/snippets/expect/gnu5.def
new file mode 100644 (file)
index 0000000..9edd87f
--- /dev/null
@@ -0,0 +1,7 @@
+        # side comments limit gnu type formatting with l=80; note extra comma
+        push @tests, [
+            "Lowest code point requiring 13 bytes to represent",    # 2**36
+            "\xff\x80\x80\x80\x80\x80\x81\x80\x80\x80\x80\x80\x80",
+            ($::is64bit) ? 0x1000000000 : -1,    # overflows on 32bit
+          ],
+          ;
diff --git a/t/snippets/expect/gnu5.gnu b/t/snippets/expect/gnu5.gnu
new file mode 100644 (file)
index 0000000..9bd9c41
--- /dev/null
@@ -0,0 +1,7 @@
+        # side comments limit gnu type formatting with l=80; note extra comma
+        push @tests, [
+            "Lowest code point requiring 13 bytes to represent",      # 2**36
+            "\xff\x80\x80\x80\x80\x80\x81\x80\x80\x80\x80\x80\x80",
+            ($::is64bit) ? 0x1000000000 : -1,    # overflows on 32bit
+                     ],
+          ;
diff --git a/t/snippets/expect/kgb_tight.def b/t/snippets/expect/kgb_tight.def
new file mode 100644 (file)
index 0000000..f3fcd35
--- /dev/null
@@ -0,0 +1,86 @@
+# a variety of line types for testing -kgb
+use strict;
+use Test;
+use Encode qw(from_to encode decode
+  encode_utf8 decode_utf8
+  find_encoding is_utf8);
+
+use charnames qw(greek);
+our $targetdir = "/usr/local/doc/HTML/Perl";
+
+local (
+    $tocfile,   $loffile,   $lotfile,         $footfile,
+    $citefile,  $idxfile,   $figure_captions, $table_captions,
+    $footnotes, $citations, %font_size,       %index,
+    %done,      $t_title,   $t_author,        $t_date,
+    $t_address, $t_affil,   $changed
+);
+my @UNITCHECKs =
+    B::unitcheck_av->isa("B::AV")
+  ? B::unitcheck_av->ARRAY
+  : ();
+
+my @CHECKs = B::check_av->isa("B::AV") ? B::check_av->ARRAY : ();
+my $dna    = Bio::LiveSeq::DNA->new( -seq => $dnasequence );
+my $min    = 1;
+my $max    = length($dnasequence);
+my $T      = $G->_strongly_connected;
+
+my %R = $T->vertex_roots;
+my @C;    # We're not calling the strongly_connected_components()
+          # Do not separate this hanging side comment from previous
+
+my $G = shift;
+
+my $exon = Bio::LiveSeq::Exon->new(
+    -seq    => $dna,
+    -start  => $min,
+    -end    => $max,
+    -strand => 1
+);
+my @inputs = (
+    0777, 0700, 0470, 0407, 0433, 0400, 0430, 0403, 0111, 0100,
+    0110, 0101, 0731, 0713, 0317, 0371, 0173, 0137
+);
+my $impulse =
+  ( 1 - $factor ) * ( 170 - $u ) + ( 350 / $u**0.65 + 500 / $u**5 ) * $factor;
+my $r = q{
+pm_to_blib: $(TO_INST_PM)
+};
+my $regcomp_re =
+  "(?<routine>ckWARN(?:\\d+)?reg\\w*|vWARN\\d+|$regcomp_fail_re)";
+my $position = List::MoreUtils::firstidx {
+    refaddr $_ == $key
+}
+
+my $alignprogram =
+"/usr/local/etc/bioinfo/fasta2/align -s /usr/local/etc/bioinfo/fasta2/idnaa.mat $fastafile1 $fastafile2 2>/dev/null | $grepcut"
+  ;    # ALIGN
+my $skel_name =
+  ( exists( $xml_tree->{'name'} ) ) ? $xml_tree->{'name'} : "";
+my $grp = GroupGetValues( $conf->{dbh}, $group_id );
+
+my $adm_profile =
+  ProfileGetUser( $conf->{dbh}, $grp->{id_admin}, $group_id );
+my $harness = TAP::Harness->new(
+    { verbosity => 1, formatter_class => "TAP::Formatter::Console" } );
+require File::Temp;
+
+require Time::HiRes;
+
+my ( $fh, $filename ) = File::Temp::tempfile("Time-HiRes-utime-XXXXXXXXX");
+use File::Basename qw[dirname];
+my $dirname = dirname($filename);
+my $CUT     = qr/\n=cut.*$EOP/;
+
+my $pod_or_DATA = qr/
+              ^=(?:head[1-4]|item) .*? $CUT
+            | ^=pod .*? $CUT
+            | ^=for .*? $CUT
+            | ^=begin .*? $CUT
+            | ^__(DATA|END)__\r?\n.*
+            /smx;
+
+require Cwd;
+print "continuing\n";
+exit 1;
index af1ff2bf13c4d8bc59383899b76a170df8188324..4db197b20d106811f0685884f5833d091731dee3 100644 (file)
@@ -1,8 +1,8 @@
 if ( $PLATFORM eq 'aix' ) {
     skip_symbols( [ qw(
-          Perl_dump_fds
-          Perl_ErrorNo
-          Perl_GetVars
-          PL_sys_intern
-          ) ] );
+        Perl_dump_fds
+        Perl_ErrorNo
+        Perl_GetVars
+        PL_sys_intern
+    ) ] );
 }
index c84f42c9be540931923ac9db78a2f9387fc01bfc..fcb93647fcfe4b141d1e844008e145af30bc86e5 100644 (file)
@@ -1,11 +1,11 @@
 # qw weld with -wn
 use_all_ok( qw{
-      PPI
-      PPI::Tokenizer
-      PPI::Lexer
-      PPI::Dumper
-      PPI::Find
-      PPI::Normal
-      PPI::Util
-      PPI::Cache
-      } );
+    PPI
+    PPI::Tokenizer
+    PPI::Lexer
+    PPI::Dumper
+    PPI::Find
+    PPI::Normal
+    PPI::Util
+    PPI::Cache
+} );
diff --git a/t/snippets/expect/wngnu1.def b/t/snippets/expect/wngnu1.def
new file mode 100644 (file)
index 0000000..123229b
--- /dev/null
@@ -0,0 +1,17 @@
+    # test with -wn -gnu
+    foreach my $parameter (
+        qw(
+        set_themes
+        add_themes
+        severity
+        maximum_violations_per_document
+        _non_public_data
+        )
+      )
+    {
+        is(
+            $config->get($parameter),
+            undef,
+            qq<"$parameter" is not defined via get() for $policy_short_name.>,
+        );
+    }
diff --git a/t/snippets/gnu5.in b/t/snippets/gnu5.in
new file mode 100644 (file)
index 0000000..9edd87f
--- /dev/null
@@ -0,0 +1,7 @@
+        # side comments limit gnu type formatting with l=80; note extra comma
+        push @tests, [
+            "Lowest code point requiring 13 bytes to represent",    # 2**36
+            "\xff\x80\x80\x80\x80\x80\x81\x80\x80\x80\x80\x80\x80",
+            ($::is64bit) ? 0x1000000000 : -1,    # overflows on 32bit
+          ],
+          ;
diff --git a/t/snippets/kgb_tight.def b/t/snippets/kgb_tight.def
new file mode 100644 (file)
index 0000000..fb3b6ce
--- /dev/null
@@ -0,0 +1 @@
+-nkgbi -kgbb=0 -kgba=2 -kgbs=1 -kgbd
diff --git a/t/snippets/kgb_tight.in b/t/snippets/kgb_tight.in
new file mode 100644 (file)
index 0000000..4bb8cba
--- /dev/null
@@ -0,0 +1,87 @@
+# a variety of line types for testing -kgb
+use strict;
+use Test;
+use Encode qw(from_to encode decode
+  encode_utf8 decode_utf8
+  find_encoding is_utf8);
+
+use charnames qw(greek);
+our $targetdir = "/usr/local/doc/HTML/Perl";
+
+local (
+    $tocfile,   $loffile,   $lotfile,         $footfile,
+    $citefile,  $idxfile,   $figure_captions, $table_captions,
+    $footnotes, $citations, %font_size,       %index,
+    %done,      $t_title,   $t_author,        $t_date,
+    $t_address, $t_affil,   $changed
+);
+my @UNITCHECKs =
+    B::unitcheck_av->isa("B::AV")
+  ? B::unitcheck_av->ARRAY
+  : ();
+
+my @CHECKs = B::check_av->isa("B::AV") ? B::check_av->ARRAY : ();
+my $dna  = Bio::LiveSeq::DNA->new( -seq => $dnasequence );
+my $min  = 1;
+my $max  = length($dnasequence);
+my $T = $G->_strongly_connected;
+
+my %R = $T->vertex_roots;
+my @C;    # We're not calling the strongly_connected_components()
+         # Do not separate this hanging side comment from previous
+
+my $G = shift;
+
+my $exon = Bio::LiveSeq::Exon->new(
+    -seq    => $dna,
+    -start  => $min,
+    -end    => $max,
+    -strand => 1
+);
+my @inputs = (
+    0777, 0700, 0470, 0407, 0433, 0400, 0430, 0403, 0111, 0100,
+    0110, 0101, 0731, 0713, 0317, 0371, 0173, 0137
+);
+my $impulse =
+  ( 1 - $factor ) * ( 170 - $u ) +
+  ( 350 / $u**0.65 + 500 / $u**5 ) * $factor;
+my $r = q{
+pm_to_blib: $(TO_INST_PM)
+};
+my $regcomp_re =
+  "(?<routine>ckWARN(?:\\d+)?reg\\w*|vWARN\\d+|$regcomp_fail_re)";
+my $position = List::MoreUtils::firstidx {
+    refaddr $_ == $key
+}
+
+my $alignprogram =
+"/usr/local/etc/bioinfo/fasta2/align -s /usr/local/etc/bioinfo/fasta2/idnaa.mat $fastafile1 $fastafile2 2>/dev/null | $grepcut"
+  ;                                                               # ALIGN
+my $skel_name =
+  ( exists( $xml_tree->{'name'} ) ) ? $xml_tree->{'name'} : "";
+my $grp = GroupGetValues( $conf->{dbh}, $group_id );
+
+my $adm_profile =
+  ProfileGetUser( $conf->{dbh}, $grp->{id_admin}, $group_id );
+my $harness = TAP::Harness->new(
+    { verbosity => 1, formatter_class => "TAP::Formatter::Console" } );
+require File::Temp;
+
+require Time::HiRes;
+
+my ( $fh, $filename ) = File::Temp::tempfile("Time-HiRes-utime-XXXXXXXXX");
+use File::Basename qw[dirname];
+my $dirname = dirname($filename);
+my $CUT         = qr/\n=cut.*$EOP/;
+
+my $pod_or_DATA = qr/
+              ^=(?:head[1-4]|item) .*? $CUT
+            | ^=pod .*? $CUT
+            | ^=for .*? $CUT
+            | ^=begin .*? $CUT
+            | ^__(DATA|END)__\r?\n.*
+            /smx;
+
+require Cwd;
+print "continuing\n";
+exit 1;
index 225f2fd128d9a1da093daa893a0ba1e81fd233ea..bdf78607d5056242fc632ba637ceeb27ece3d3f4 100644 (file)
 ../snippets14.t        kgb4.kgb
 ../snippets14.t        kgb5.def
 ../snippets14.t        kgb5.kgb
+../snippets14.t        kgbd.def
+../snippets14.t        kgbd.kgbd
+../snippets14.t        kgb_tight.def
 ../snippets2.t angle.def
 ../snippets2.t arrows1.def
 ../snippets2.t arrows2.def
 ../snippets9.t rt98902.def
 ../snippets9.t rt98902.rt98902
 ../snippets9.t rt99961.def
-../snippets14.t        kgbd.def
-../snippets14.t        kgbd.kgbd
+../snippets14.t        gnu5.def
+../snippets15.t        gnu5.gnu
+../snippets15.t        wngnu1.def
diff --git a/t/snippets/wngnu1.in b/t/snippets/wngnu1.in
new file mode 100644 (file)
index 0000000..123229b
--- /dev/null
@@ -0,0 +1,17 @@
+    # test with -wn -gnu
+    foreach my $parameter (
+        qw(
+        set_themes
+        add_themes
+        severity
+        maximum_violations_per_document
+        _non_public_data
+        )
+      )
+    {
+        is(
+            $config->get($parameter),
+            undef,
+            qq<"$parameter" is not defined via get() for $policy_short_name.>,
+        );
+    }
diff --git a/t/snippets/wngun.par b/t/snippets/wngun.par
new file mode 100644 (file)
index 0000000..0b4f3e2
--- /dev/null
@@ -0,0 +1 @@
+-wn -gnu
index c0e3672405fa0f41aa60ca4bcf658865503470db..9b0332a17007559a70c36884fad3796d0b1c7864 100644 (file)
@@ -378,11 +378,11 @@ if ( $PLATFORM eq 'aix' ) {
             expect => <<'#12...........',
 if ( $PLATFORM eq 'aix' ) {
     skip_symbols( [ qw(
-          Perl_dump_fds
-          Perl_ErrorNo
-          Perl_GetVars
-          PL_sys_intern
-          ) ] );
+        Perl_dump_fds
+        Perl_ErrorNo
+        Perl_GetVars
+        PL_sys_intern
+    ) ] );
 }
 #12...........
         },
@@ -481,15 +481,15 @@ use_all_ok(
             expect => <<'#18...........',
 # qw weld with -wn
 use_all_ok( qw{
-      PPI
-      PPI::Tokenizer
-      PPI::Lexer
-      PPI::Dumper
-      PPI::Find
-      PPI::Normal
-      PPI::Util
-      PPI::Cache
-      } );
+    PPI
+    PPI::Tokenizer
+    PPI::Lexer
+    PPI::Dumper
+    PPI::Find
+    PPI::Normal
+    PPI::Util
+    PPI::Cache
+} );
 #18...........
         },
 
index 4965d32b94a6ff161c322de7b91a82b9eca0532e..85d33515fc7fd504c99b7cd384af5a71389cb3c0 100644 (file)
@@ -18,6 +18,8 @@
 #15 kgb5.kgb
 #16 kgbd.def
 #17 kgbd.kgbd
+#18 kgb_tight.def
+#19 gnu5.def
 
 # To locate test #13 you can search for its name or the string '#13'
 
@@ -84,6 +86,16 @@ else                                          { $rslt = vmspath($dir); }
         else                   { print " " }
 ----------
 
+        'gnu5' => <<'----------',
+        # side comments limit gnu type formatting with l=80; note extra comma
+        push @tests, [
+            "Lowest code point requiring 13 bytes to represent",    # 2**36
+            "\xff\x80\x80\x80\x80\x80\x81\x80\x80\x80\x80\x80\x80",
+            ($::is64bit) ? 0x1000000000 : -1,    # overflows on 32bit
+          ],
+          ;
+----------
+
         'kgb1' => <<'----------',
 # a variety of line types for testing -kgb
 use strict;
@@ -264,6 +276,96 @@ my $result =
   : "-A";
 my $F = "0";
 print "with -kgb, put blank above this line; result=$result\n";
+----------
+
+        'kgb_tight' => <<'----------',
+# a variety of line types for testing -kgb
+use strict;
+use Test;
+use Encode qw(from_to encode decode
+  encode_utf8 decode_utf8
+  find_encoding is_utf8);
+
+use charnames qw(greek);
+our $targetdir = "/usr/local/doc/HTML/Perl";
+
+local (
+    $tocfile,   $loffile,   $lotfile,         $footfile,
+    $citefile,  $idxfile,   $figure_captions, $table_captions,
+    $footnotes, $citations, %font_size,       %index,
+    %done,      $t_title,   $t_author,        $t_date,
+    $t_address, $t_affil,   $changed
+);
+my @UNITCHECKs =
+    B::unitcheck_av->isa("B::AV")
+  ? B::unitcheck_av->ARRAY
+  : ();
+
+my @CHECKs = B::check_av->isa("B::AV") ? B::check_av->ARRAY : ();
+my $dna  = Bio::LiveSeq::DNA->new( -seq => $dnasequence );
+my $min  = 1;
+my $max  = length($dnasequence);
+my $T = $G->_strongly_connected;
+
+my %R = $T->vertex_roots;
+my @C;    # We're not calling the strongly_connected_components()
+         # Do not separate this hanging side comment from previous
+
+my $G = shift;
+
+my $exon = Bio::LiveSeq::Exon->new(
+    -seq    => $dna,
+    -start  => $min,
+    -end    => $max,
+    -strand => 1
+);
+my @inputs = (
+    0777, 0700, 0470, 0407, 0433, 0400, 0430, 0403, 0111, 0100,
+    0110, 0101, 0731, 0713, 0317, 0371, 0173, 0137
+);
+my $impulse =
+  ( 1 - $factor ) * ( 170 - $u ) +
+  ( 350 / $u**0.65 + 500 / $u**5 ) * $factor;
+my $r = q{
+pm_to_blib: $(TO_INST_PM)
+};
+my $regcomp_re =
+  "(?<routine>ckWARN(?:\\d+)?reg\\w*|vWARN\\d+|$regcomp_fail_re)";
+my $position = List::MoreUtils::firstidx {
+    refaddr $_ == $key
+}
+
+my $alignprogram =
+"/usr/local/etc/bioinfo/fasta2/align -s /usr/local/etc/bioinfo/fasta2/idnaa.mat $fastafile1 $fastafile2 2>/dev/null | $grepcut"
+  ;                                                               # ALIGN
+my $skel_name =
+  ( exists( $xml_tree->{'name'} ) ) ? $xml_tree->{'name'} : "";
+my $grp = GroupGetValues( $conf->{dbh}, $group_id );
+
+my $adm_profile =
+  ProfileGetUser( $conf->{dbh}, $grp->{id_admin}, $group_id );
+my $harness = TAP::Harness->new(
+    { verbosity => 1, formatter_class => "TAP::Formatter::Console" } );
+require File::Temp;
+
+require Time::HiRes;
+
+my ( $fh, $filename ) = File::Temp::tempfile("Time-HiRes-utime-XXXXXXXXX");
+use File::Basename qw[dirname];
+my $dirname = dirname($filename);
+my $CUT         = qr/\n=cut.*$EOP/;
+
+my $pod_or_DATA = qr/
+              ^=(?:head[1-4]|item) .*? $CUT
+            | ^=pod .*? $CUT
+            | ^=for .*? $CUT
+            | ^=begin .*? $CUT
+            | ^__(DATA|END)__\r?\n.*
+            /smx;
+
+require Cwd;
+print "continuing\n";
+exit 1;
 ----------
 
         'kgbd' => <<'----------',
@@ -822,6 +924,113 @@ use vars qw($VERSION @ISA @EXPORT);
 $VERSION = 0.01;
 #17...........
         },
+
+        'kgb_tight.def' => {
+            source => "kgb_tight",
+            params => "def",
+            expect => <<'#18...........',
+# a variety of line types for testing -kgb
+use strict;
+use Test;
+use Encode qw(from_to encode decode
+  encode_utf8 decode_utf8
+  find_encoding is_utf8);
+
+use charnames qw(greek);
+our $targetdir = "/usr/local/doc/HTML/Perl";
+
+local (
+    $tocfile,   $loffile,   $lotfile,         $footfile,
+    $citefile,  $idxfile,   $figure_captions, $table_captions,
+    $footnotes, $citations, %font_size,       %index,
+    %done,      $t_title,   $t_author,        $t_date,
+    $t_address, $t_affil,   $changed
+);
+my @UNITCHECKs =
+    B::unitcheck_av->isa("B::AV")
+  ? B::unitcheck_av->ARRAY
+  : ();
+
+my @CHECKs = B::check_av->isa("B::AV") ? B::check_av->ARRAY : ();
+my $dna    = Bio::LiveSeq::DNA->new( -seq => $dnasequence );
+my $min    = 1;
+my $max    = length($dnasequence);
+my $T      = $G->_strongly_connected;
+
+my %R = $T->vertex_roots;
+my @C;    # We're not calling the strongly_connected_components()
+          # Do not separate this hanging side comment from previous
+
+my $G = shift;
+
+my $exon = Bio::LiveSeq::Exon->new(
+    -seq    => $dna,
+    -start  => $min,
+    -end    => $max,
+    -strand => 1
+);
+my @inputs = (
+    0777, 0700, 0470, 0407, 0433, 0400, 0430, 0403, 0111, 0100,
+    0110, 0101, 0731, 0713, 0317, 0371, 0173, 0137
+);
+my $impulse =
+  ( 1 - $factor ) * ( 170 - $u ) + ( 350 / $u**0.65 + 500 / $u**5 ) * $factor;
+my $r = q{
+pm_to_blib: $(TO_INST_PM)
+};
+my $regcomp_re =
+  "(?<routine>ckWARN(?:\\d+)?reg\\w*|vWARN\\d+|$regcomp_fail_re)";
+my $position = List::MoreUtils::firstidx {
+    refaddr $_ == $key
+}
+
+my $alignprogram =
+"/usr/local/etc/bioinfo/fasta2/align -s /usr/local/etc/bioinfo/fasta2/idnaa.mat $fastafile1 $fastafile2 2>/dev/null | $grepcut"
+  ;    # ALIGN
+my $skel_name =
+  ( exists( $xml_tree->{'name'} ) ) ? $xml_tree->{'name'} : "";
+my $grp = GroupGetValues( $conf->{dbh}, $group_id );
+
+my $adm_profile =
+  ProfileGetUser( $conf->{dbh}, $grp->{id_admin}, $group_id );
+my $harness = TAP::Harness->new(
+    { verbosity => 1, formatter_class => "TAP::Formatter::Console" } );
+require File::Temp;
+
+require Time::HiRes;
+
+my ( $fh, $filename ) = File::Temp::tempfile("Time-HiRes-utime-XXXXXXXXX");
+use File::Basename qw[dirname];
+my $dirname = dirname($filename);
+my $CUT     = qr/\n=cut.*$EOP/;
+
+my $pod_or_DATA = qr/
+              ^=(?:head[1-4]|item) .*? $CUT
+            | ^=pod .*? $CUT
+            | ^=for .*? $CUT
+            | ^=begin .*? $CUT
+            | ^__(DATA|END)__\r?\n.*
+            /smx;
+
+require Cwd;
+print "continuing\n";
+exit 1;
+#18...........
+        },
+
+        'gnu5.def' => {
+            source => "gnu5",
+            params => "def",
+            expect => <<'#19...........',
+        # side comments limit gnu type formatting with l=80; note extra comma
+        push @tests, [
+            "Lowest code point requiring 13 bytes to represent",    # 2**36
+            "\xff\x80\x80\x80\x80\x80\x81\x80\x80\x80\x80\x80\x80",
+            ($::is64bit) ? 0x1000000000 : -1,    # overflows on 32bit
+          ],
+          ;
+#19...........
+        },
     };
 
     my $ntests = 0 + keys %{$rtests};
diff --git a/t/snippets15.t b/t/snippets15.t
new file mode 100644 (file)
index 0000000..21c705e
--- /dev/null
@@ -0,0 +1,158 @@
+# Created with: ./make_t.pl
+
+# Contents:
+#1 gnu5.gnu
+#2 wngnu1.def
+
+# To locate test #13 you can search for its name or the string '#13'
+
+use strict;
+use Test;
+use Carp;
+use Perl::Tidy;
+my $rparams;
+my $rsources;
+my $rtests;
+
+BEGIN {
+
+    ###########################################
+    # BEGIN SECTION 1: Parameter combinations #
+    ###########################################
+    $rparams = {
+        'def' => "",
+        'gnu' => "-gnu",
+    };
+
+    ############################
+    # BEGIN SECTION 2: Sources #
+    ############################
+    $rsources = {
+
+        'gnu5' => <<'----------',
+        # side comments limit gnu type formatting with l=80; note extra comma
+        push @tests, [
+            "Lowest code point requiring 13 bytes to represent",    # 2**36
+            "\xff\x80\x80\x80\x80\x80\x81\x80\x80\x80\x80\x80\x80",
+            ($::is64bit) ? 0x1000000000 : -1,    # overflows on 32bit
+          ],
+          ;
+----------
+
+        'wngnu1' => <<'----------',
+    # test with -wn -gnu
+    foreach my $parameter (
+        qw(
+        set_themes
+        add_themes
+        severity
+        maximum_violations_per_document
+        _non_public_data
+        )
+      )
+    {
+        is(
+            $config->get($parameter),
+            undef,
+            qq<"$parameter" is not defined via get() for $policy_short_name.>,
+        );
+    }
+----------
+    };
+
+    ####################################
+    # BEGIN SECTION 3: Expected output #
+    ####################################
+    $rtests = {
+
+        'gnu5.gnu' => {
+            source => "gnu5",
+            params => "gnu",
+            expect => <<'#1...........',
+        # side comments limit gnu type formatting with l=80; note extra comma
+        push @tests, [
+            "Lowest code point requiring 13 bytes to represent",      # 2**36
+            "\xff\x80\x80\x80\x80\x80\x81\x80\x80\x80\x80\x80\x80",
+            ($::is64bit) ? 0x1000000000 : -1,    # overflows on 32bit
+                     ],
+          ;
+#1...........
+        },
+
+        'wngnu1.def' => {
+            source => "wngnu1",
+            params => "def",
+            expect => <<'#2...........',
+    # test with -wn -gnu
+    foreach my $parameter (
+        qw(
+        set_themes
+        add_themes
+        severity
+        maximum_violations_per_document
+        _non_public_data
+        )
+      )
+    {
+        is(
+            $config->get($parameter),
+            undef,
+            qq<"$parameter" is not defined via get() for $policy_short_name.>,
+        );
+    }
+#2...........
+        },
+    };
+
+    my $ntests = 0 + keys %{$rtests};
+    plan tests => $ntests;
+}
+
+###############
+# EXECUTE TESTS
+###############
+
+foreach my $key ( sort keys %{$rtests} ) {
+    my $output;
+    my $sname  = $rtests->{$key}->{source};
+    my $expect = $rtests->{$key}->{expect};
+    my $pname  = $rtests->{$key}->{params};
+    my $source = $rsources->{$sname};
+    my $params = defined($pname) ? $rparams->{$pname} : "";
+    my $stderr_string;
+    my $errorfile_string;
+    my $err = Perl::Tidy::perltidy(
+        source      => \$source,
+        destination => \$output,
+        perltidyrc  => \$params,
+        argv        => '',             # for safety; hide any ARGV from perltidy
+        stderr      => \$stderr_string,
+        errorfile => \$errorfile_string,    # not used when -se flag is set
+    );
+    if ( $err || $stderr_string || $errorfile_string ) {
+        if ($err) {
+            print STDERR
+"This error received calling Perl::Tidy with '$sname' + '$pname'\n";
+            ok( !$err );
+        }
+        if ($stderr_string) {
+            print STDERR "---------------------\n";
+            print STDERR "<<STDERR>>\n$stderr_string\n";
+            print STDERR "---------------------\n";
+            print STDERR
+"This error received calling Perl::Tidy with '$sname' + '$pname'\n";
+            ok( !$stderr_string );
+        }
+        if ($errorfile_string) {
+            print STDERR "---------------------\n";
+            print STDERR "<<.ERR file>>\n$errorfile_string\n";
+            print STDERR "---------------------\n";
+            print STDERR
+"This error received calling Perl::Tidy with '$sname' + '$pname'\n";
+            ok( !$errorfile_string );
+        }
+    }
+    else {
+        ok( $output, $expect );
+    }
+}