]> git.donarmstrong.com Git - perltidy.git/commitdiff
update test cases for recent changes
authorSteve Hancock <perltidy@users.sourceforge.net>
Thu, 16 Apr 2020 17:57:05 +0000 (10:57 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Thu, 16 Apr 2020 17:57:05 +0000 (10:57 -0700)
t/snippets/align32.in [new file with mode: 0644]
t/snippets/expect/align32.def [new file with mode: 0644]
t/snippets/expect/iscl1.iscl
t/snippets/expect/ternary4.def [new file with mode: 0644]
t/snippets/packing_list.txt
t/snippets/ternary4.in [new file with mode: 0644]
t/snippets17.t
t/snippets4.t

diff --git a/t/snippets/align32.in b/t/snippets/align32.in
new file mode 100644 (file)
index 0000000..7fc51fe
--- /dev/null
@@ -0,0 +1,4 @@
+# should not get alignment here:
+my $c_sub_khwnd = WindowFromId $k_hwnd, 0x8008;    # FID_CLIENT
+ok $c_sub_khwnd, 'have kids client window';
+ok IsWindow($c_sub_khwnd), 'IsWindow works on the client';
diff --git a/t/snippets/expect/align32.def b/t/snippets/expect/align32.def
new file mode 100644 (file)
index 0000000..7fc51fe
--- /dev/null
@@ -0,0 +1,4 @@
+# should not get alignment here:
+my $c_sub_khwnd = WindowFromId $k_hwnd, 0x8008;    # FID_CLIENT
+ok $c_sub_khwnd, 'have kids client window';
+ok IsWindow($c_sub_khwnd), 'IsWindow works on the client';
index 1465612f80e694dff549763f934c3f3c712fe7f8..a30b11f92191ef7a53228ec8384efd2ff07131a7 100644 (file)
@@ -1,4 +1,4 @@
         # -iscl will not allow alignment of hanging side comments (currently)
-        $gsmatch = ( $sub >= 50 ) ? "equal" : "lequal"; # Force an equal match for
-             # dev, but be more forgiving
-             # for releases
+        $gsmatch = ( $sub >= 50 ) ? "equal" : "lequal";    # Force an equal match for
+                                                           # dev, but be more forgiving
+                                                           # for releases
diff --git a/t/snippets/expect/ternary4.def b/t/snippets/expect/ternary4.def
new file mode 100644 (file)
index 0000000..e8b4fc7
--- /dev/null
@@ -0,0 +1,7 @@
+# some side comments
+*{"${callpkg}::$sym"} = $type eq '&' ? \&{"${pkg}::$sym"}    #
+  : $type eq '$'                     ? \${"${pkg}::$sym"}    #
+  : $type eq '@'                     ? \@{"${pkg}::$sym"}
+  : $type eq '%'                     ? \%{"${pkg}::$sym"}    # side comment
+  : $type eq '*'                     ? *{"${pkg}::$sym"}     #
+  :   do { require Carp; Carp::croak("Can't export symbol: $type$sym") };
index 8036aa8f0f980b8bb30c87652262ab3609f22210..6d6b34fa701b18e20b50c133dbddeefa332770cd 100644 (file)
 ../snippets17.t        pbp6.pbp
 ../snippets17.t        bos.bos
 ../snippets17.t        bos.def
+../snippets17.t        long_line.def
+../snippets17.t        long_line.long_line
 ../snippets2.t angle.def
 ../snippets2.t arrows1.def
 ../snippets2.t arrows2.def
 ../snippets9.t rt98902.def
 ../snippets9.t rt98902.rt98902
 ../snippets9.t rt99961.def
-../snippets17.t        long_line.def
-../snippets17.t        long_line.long_line
+../snippets17.t        align32.def
+../snippets17.t        ternary4.def
diff --git a/t/snippets/ternary4.in b/t/snippets/ternary4.in
new file mode 100644 (file)
index 0000000..87d965a
--- /dev/null
@@ -0,0 +1,8 @@
+# some side comments
+*{"${callpkg}::$sym"} = 
+      $type eq '&' ? \&{"${pkg}::$sym"}    #
+    : $type eq '$' ? \${"${pkg}::$sym"}    #
+    : $type eq '@' ? \@{"${pkg}::$sym"}
+    : $type eq '%' ? \%{"${pkg}::$sym"}    # side comment
+    : $type eq '*' ? *{"${pkg}::$sym"}     #
+    :   do { require Carp; Carp::croak("Can't export symbol: $type$sym") };
index 2a18bc593aeadd648b4df330d284a2d87dc830b5..fec8deeec9e409e33bebc435289934cc5c526568 100644 (file)
@@ -16,6 +16,8 @@
 #13 bos.def
 #14 long_line.def
 #15 long_line.long_line
+#16 align32.def
+#17 ternary4.def
 
 # To locate test #13 you can search for its name or the string '#13'
 
@@ -47,6 +49,13 @@ BEGIN {
     ############################
     $rsources = {
 
+        'align32' => <<'----------',
+# should not get alignment here:
+my $c_sub_khwnd = WindowFromId $k_hwnd, 0x8008;    # FID_CLIENT
+ok $c_sub_khwnd, 'have kids client window';
+ok IsWindow($c_sub_khwnd), 'IsWindow works on the client';
+----------
+
         'bos' => <<'----------',
         $top_label->set_text( gettext("check permissions.") )
           ;
@@ -125,6 +134,17 @@ my $subref = sub ( $cat, $id = do { state $auto_id = 0; $auto_id++ } ) {
 };
 ----------
 
+        'ternary4' => <<'----------',
+# some side comments
+*{"${callpkg}::$sym"} = 
+      $type eq '&' ? \&{"${pkg}::$sym"}    #
+    : $type eq '$' ? \${"${pkg}::$sym"}    #
+    : $type eq '@' ? \@{"${pkg}::$sym"}
+    : $type eq '%' ? \%{"${pkg}::$sym"}    # side comment
+    : $type eq '*' ? *{"${pkg}::$sym"}     #
+    :   do { require Carp; Carp::croak("Can't export symbol: $type$sym") };
+----------
+
         'wn7' => <<'----------',
                     # do not weld paren to opening one-line non-paren container
                     $Self->_Add($SortOrderDisplay{$Field->GenerateFieldForSelectSQL()});
@@ -482,6 +502,31 @@ $body = SOAP::Data->name('~V:Fault')->attr( { 'xmlns' => $SOAP::Constants::NS_EN
 );
 #15...........
         },
+
+        'align32.def' => {
+            source => "align32",
+            params => "def",
+            expect => <<'#16...........',
+# should not get alignment here:
+my $c_sub_khwnd = WindowFromId $k_hwnd, 0x8008;    # FID_CLIENT
+ok $c_sub_khwnd, 'have kids client window';
+ok IsWindow($c_sub_khwnd), 'IsWindow works on the client';
+#16...........
+        },
+
+        'ternary4.def' => {
+            source => "ternary4",
+            params => "def",
+            expect => <<'#17...........',
+# some side comments
+*{"${callpkg}::$sym"} = $type eq '&' ? \&{"${pkg}::$sym"}    #
+  : $type eq '$'                     ? \${"${pkg}::$sym"}    #
+  : $type eq '@'                     ? \@{"${pkg}::$sym"}
+  : $type eq '%'                     ? \%{"${pkg}::$sym"}    # side comment
+  : $type eq '*'                     ? *{"${pkg}::$sym"}     #
+  :   do { require Carp; Carp::croak("Can't export symbol: $type$sym") };
+#17...........
+        },
     };
 
     my $ntests = 0 + keys %{$rtests};
index 374e4c2bcf010ffa50264d9b7a43bfb5b980fa66..1878425c5104af2f3d66a2c1259b21975c9b08b1 100644 (file)
@@ -474,9 +474,9 @@ else                    { $editlblk = "off"; $editlblkchecked = "unchecked" }
             params => "iscl",
             expect => <<'#18...........',
         # -iscl will not allow alignment of hanging side comments (currently)
-        $gsmatch = ( $sub >= 50 ) ? "equal" : "lequal"; # Force an equal match for
-             # dev, but be more forgiving
-             # for releases
+        $gsmatch = ( $sub >= 50 ) ? "equal" : "lequal";    # Force an equal match for
+                                                           # dev, but be more forgiving
+                                                           # for releases
 #18...........
         },