]> git.donarmstrong.com Git - perltidy.git/commitdiff
added test cases for -xci
authorSteve Hancock <perltidy@users.sourceforge.net>
Fri, 9 Oct 2020 04:14:43 +0000 (21:14 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Fri, 9 Oct 2020 04:14:43 +0000 (21:14 -0700)
t/snippets/expect/xci.def [new file with mode: 0644]
t/snippets/expect/xci.xci1 [new file with mode: 0644]
t/snippets/expect/xci.xci2 [new file with mode: 0644]
t/snippets/packing_list.txt
t/snippets/xci.in [new file with mode: 0644]
t/snippets/xci1.par [new file with mode: 0644]
t/snippets/xci2.par [new file with mode: 0644]
t/snippets22.t

diff --git a/t/snippets/expect/xci.def b/t/snippets/expect/xci.def
new file mode 100644 (file)
index 0000000..cde75b9
--- /dev/null
@@ -0,0 +1,22 @@
+$self->{_text} = (
+     !$section        ? ''
+    : $type eq 'item' ? "the $section entry"
+    :                   "the section on $section"
+  )
+  . (
+    $page
+    ? ( $section ? ' in ' : '' ) . "the $page$page_ext manpage"
+    : ' elsewhere in this document'
+  );
+
+my $otherHashRef =
+  $condition
+  ? {
+    'a' => 'a value',
+    'b' => 'b value',
+    'c' => {
+        'd' => 'd value',
+        'e' => 'e value'
+    }
+  }
+  : undef;
diff --git a/t/snippets/expect/xci.xci1 b/t/snippets/expect/xci.xci1
new file mode 100644 (file)
index 0000000..6550b9a
--- /dev/null
@@ -0,0 +1,22 @@
+$self->{_text} = (
+     !$section        ? ''
+    : $type eq 'item' ? "the $section entry"
+    :                   "the section on $section"
+  )
+  . (
+      $page
+      ? ( $section ? ' in ' : '' ) . "the $page$page_ext manpage"
+      : ' elsewhere in this document'
+  );
+
+my $otherHashRef =
+  $condition
+  ? {
+      'a' => 'a value',
+      'b' => 'b value',
+      'c' => {
+          'd' => 'd value',
+          'e' => 'e value'
+      }
+  }
+  : undef;
diff --git a/t/snippets/expect/xci.xci2 b/t/snippets/expect/xci.xci2
new file mode 100644 (file)
index 0000000..24c19b6
--- /dev/null
@@ -0,0 +1,20 @@
+$self->{_text} = (
+     !$section        ? ''
+    : $type eq 'item' ? "the $section entry"
+    :                   "the section on $section"
+    )
+    . ( $page
+        ? ( $section ? ' in ' : '' ) . "the $page$page_ext manpage"
+        : ' elsewhere in this document'
+    );
+
+my $otherHashRef
+    = $condition
+    ? { 'a' => 'a value',
+        'b' => 'b value',
+        'c' => {
+            'd' => 'd value',
+            'e' => 'e value'
+        }
+    }
+    : undef;
index 77ce0f80c4bfe509c900c94d460bfecbd5034960..18becc1348d5188f95df6e256d8ed1230741161b 100644 (file)
 ../snippets22.t        bbhb.def
 ../snippets22.t        bbhb.bbhb4
 ../snippets22.t        bbhb.bbhb5
+../snippets22.t        braces.braces7
 ../snippets3.t ce_wn1.ce_wn
 ../snippets3.t ce_wn1.def
 ../snippets3.t colin.colin
 ../snippets9.t rt98902.def
 ../snippets9.t rt98902.rt98902
 ../snippets9.t rt99961.def
-../snippets22.t        braces.braces7
+../snippets22.t        xci.def
+../snippets22.t        xci.xci1
+../snippets22.t        xci.xci2
diff --git a/t/snippets/xci.in b/t/snippets/xci.in
new file mode 100644 (file)
index 0000000..a51e55e
--- /dev/null
@@ -0,0 +1,22 @@
+$self->{_text} = (
+  !$section  ? ''
+ : $type eq 'item' ? "the $section entry"
+ : "the section on $section"
+ )
+ . (
+ $page
+ ? ( $section ? ' in ' : '' ) . "the $page$page_ext manpage"
+ : ' elsewhere in this document'
+ );
+
+my $otherHashRef =
+ $condition
+ ? {
+ 'a' => 'a value',
+ 'b' => 'b value',
+ 'c' => {
+  'd' => 'd value',
+  'e' => 'e value'
+ }
+ }
+ : undef;
diff --git a/t/snippets/xci1.par b/t/snippets/xci1.par
new file mode 100644 (file)
index 0000000..3b83a56
--- /dev/null
@@ -0,0 +1 @@
+-xci
diff --git a/t/snippets/xci2.par b/t/snippets/xci2.par
new file mode 100644 (file)
index 0000000..5c9e8cd
--- /dev/null
@@ -0,0 +1 @@
+-pbp -nst -nse -xci
index fd5bf86a5539f7d945fdf9210f1e5a71ac348d59..c36c98061017a4eb336d48dacd048c86c03bfaa2 100644 (file)
@@ -8,6 +8,9 @@
 #5 bbhb.bbhb4
 #6 bbhb.bbhb5
 #7 braces.braces7
+#8 xci.def
+#9 xci.xci1
+#10 xci.xci2
 
 # To locate test #13 you can search for its name or the string '#13'
 
@@ -34,6 +37,8 @@ BEGIN {
 ----------
         'def'       => "",
         'here_long' => "-l=33",
+        'xci1'      => "-xci",
+        'xci2'      => "-pbp -nst -nse -xci",
     };
 
     ############################
@@ -109,6 +114,31 @@ $sth= $dbh->prepare (<<"END_OF_SELECT") or die "Couldn't prepare SQL" ;
     FROM logins WHERE username='$user'
 END_OF_SELECT
 
+----------
+
+        'xci' => <<'----------',
+$self->{_text} = (
+  !$section  ? ''
+ : $type eq 'item' ? "the $section entry"
+ : "the section on $section"
+ )
+ . (
+ $page
+ ? ( $section ? ' in ' : '' ) . "the $page$page_ext manpage"
+ : ' elsewhere in this document'
+ );
+
+my $otherHashRef =
+ $condition
+ ? {
+ 'a' => 'a value',
+ 'b' => 'b value',
+ 'c' => {
+  'd' => 'd value',
+  'e' => 'e value'
+ }
+ }
+ : undef;
 ----------
     };
 
@@ -275,6 +305,91 @@ catch
   };
 #7...........
         },
+
+        'xci.def' => {
+            source => "xci",
+            params => "def",
+            expect => <<'#8...........',
+$self->{_text} = (
+     !$section        ? ''
+    : $type eq 'item' ? "the $section entry"
+    :                   "the section on $section"
+  )
+  . (
+    $page
+    ? ( $section ? ' in ' : '' ) . "the $page$page_ext manpage"
+    : ' elsewhere in this document'
+  );
+
+my $otherHashRef =
+  $condition
+  ? {
+    'a' => 'a value',
+    'b' => 'b value',
+    'c' => {
+        'd' => 'd value',
+        'e' => 'e value'
+    }
+  }
+  : undef;
+#8...........
+        },
+
+        'xci.xci1' => {
+            source => "xci",
+            params => "xci1",
+            expect => <<'#9...........',
+$self->{_text} = (
+     !$section        ? ''
+    : $type eq 'item' ? "the $section entry"
+    :                   "the section on $section"
+  )
+  . (
+      $page
+      ? ( $section ? ' in ' : '' ) . "the $page$page_ext manpage"
+      : ' elsewhere in this document'
+  );
+
+my $otherHashRef =
+  $condition
+  ? {
+      'a' => 'a value',
+      'b' => 'b value',
+      'c' => {
+          'd' => 'd value',
+          'e' => 'e value'
+      }
+  }
+  : undef;
+#9...........
+        },
+
+        'xci.xci2' => {
+            source => "xci",
+            params => "xci2",
+            expect => <<'#10...........',
+$self->{_text} = (
+     !$section        ? ''
+    : $type eq 'item' ? "the $section entry"
+    :                   "the section on $section"
+    )
+    . ( $page
+        ? ( $section ? ' in ' : '' ) . "the $page$page_ext manpage"
+        : ' elsewhere in this document'
+    );
+
+my $otherHashRef
+    = $condition
+    ? { 'a' => 'a value',
+        'b' => 'b value',
+        'c' => {
+            'd' => 'd value',
+            'e' => 'e value'
+        }
+    }
+    : undef;
+#10...........
+        },
     };
 
     my $ntests = 0 + keys %{$rtests};