]> git.donarmstrong.com Git - perltidy.git/commitdiff
added tests for changes in qw formatting
authorSteve Hancock <perltidy@users.sourceforge.net>
Sun, 27 Dec 2020 14:48:24 +0000 (06:48 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sun, 27 Dec 2020 14:48:24 +0000 (06:48 -0800)
t/snippets/expect/qw.def [new file with mode: 0644]
t/snippets/packing_list.txt
t/snippets/qw.in [new file with mode: 0644]
t/snippets23.t

diff --git a/t/snippets/expect/qw.def b/t/snippets/expect/qw.def
new file mode 100644 (file)
index 0000000..a658d1b
--- /dev/null
@@ -0,0 +1,41 @@
+    # do not outdent ending ) more than initial qw line
+    if ( $pos == 0 ) {
+        @return = grep( /^$word/,
+            sort qw(
+              ! a b d h i m o q r u autobundle clean
+              make test install force reload look
+            ) );
+    }
+
+    # outdent ')' even if opening is not '('
+    @EXPORT = (
+        qw)
+          i Re Im rho theta arg
+          sqrt log ln
+          log10 logn cbrt root
+          cplx cplxe
+        ),
+        @trig
+    );
+
+    # outdent '>' like ')'
+    @EXPORT = (
+        qw<
+          i Re Im rho theta arg
+          sqrt log ln
+          log10 logn cbrt root
+          cplx cplxe
+        >,
+        @trig
+    );
+
+    # but ';' not outdented
+    @EXPORT = (
+        qw;
+          i Re Im rho theta arg
+          sqrt log ln
+          log10 logn cbrt root
+          cplx cplxe
+          ;,
+        @trig
+    );
index ac76c9c0e9c69b02982f7894ad24da31f682d86e..78559e5b5dea876a8fc1ed650d164e735713b6a9 100644 (file)
 ../snippets9.t rt98902.def
 ../snippets9.t rt98902.rt98902
 ../snippets9.t rt99961.def
+../snippets23.t        qw.def
diff --git a/t/snippets/qw.in b/t/snippets/qw.in
new file mode 100644 (file)
index 0000000..399158b
--- /dev/null
@@ -0,0 +1,41 @@
+    # do not outdent ending ) more than initial qw line
+    if ( $pos == 0 ) {
+        @return = grep( /^$word/,
+            sort qw(
+              ! a b d h i m o q r u autobundle clean
+              make test install force reload look
+        ) );
+    }
+
+    # outdent ')' even if opening is not '('
+    @EXPORT = (
+        qw)
+          i Re Im rho theta arg
+          sqrt log ln
+          log10 logn cbrt root
+          cplx cplxe
+        ),
+        @trig
+    );
+
+    # outdent '>' like ')'
+    @EXPORT = (
+        qw<
+          i Re Im rho theta arg
+          sqrt log ln
+          log10 logn cbrt root
+          cplx cplxe
+        >,
+        @trig
+    );
+
+    # but ';' not outdented
+    @EXPORT = (
+        qw;
+          i Re Im rho theta arg
+          sqrt log ln
+          log10 logn cbrt root
+          cplx cplxe
+          ;,
+        @trig
+    );
index 8d7e6a5b6c8b33ed3ad6b28df66b3c0e80d51da7..2e4d09158379a0e9796f258eaa07ae590a26b800 100644 (file)
@@ -19,6 +19,7 @@
 #16 align34.def
 #17 git47.def
 #18 git47.git47
+#19 qw.def
 
 # To locate test #13 you can search for its name or the string '#13'
 
@@ -174,6 +175,50 @@ my @sorted = map { $_->[0] }
   map { [ $_, rand ] } @list;
 ----------
 
+        'qw' => <<'----------',
+    # do not outdent ending ) more than initial qw line
+    if ( $pos == 0 ) {
+        @return = grep( /^$word/,
+            sort qw(
+              ! a b d h i m o q r u autobundle clean
+              make test install force reload look
+        ) );
+    }
+
+    # outdent ')' even if opening is not '('
+    @EXPORT = (
+        qw)
+          i Re Im rho theta arg
+          sqrt log ln
+          log10 logn cbrt root
+          cplx cplxe
+        ),
+        @trig
+    );
+
+    # outdent '>' like ')'
+    @EXPORT = (
+        qw<
+          i Re Im rho theta arg
+          sqrt log ln
+          log10 logn cbrt root
+          cplx cplxe
+        >,
+        @trig
+    );
+
+    # but ';' not outdented
+    @EXPORT = (
+        qw;
+          i Re Im rho theta arg
+          sqrt log ln
+          log10 logn cbrt root
+          cplx cplxe
+          ;,
+        @trig
+    );
+----------
+
         'sbcp' => <<'----------',
 @month_of_year = (
     'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct',
@@ -620,6 +665,54 @@ return Mojo::Promise->resolve($query_params)->then(&_reveal_event)->then(sub ($c
 });
 #18...........
         },
+
+        'qw.def' => {
+            source => "qw",
+            params => "def",
+            expect => <<'#19...........',
+    # do not outdent ending ) more than initial qw line
+    if ( $pos == 0 ) {
+        @return = grep( /^$word/,
+            sort qw(
+              ! a b d h i m o q r u autobundle clean
+              make test install force reload look
+            ) );
+    }
+
+    # outdent ')' even if opening is not '('
+    @EXPORT = (
+        qw)
+          i Re Im rho theta arg
+          sqrt log ln
+          log10 logn cbrt root
+          cplx cplxe
+        ),
+        @trig
+    );
+
+    # outdent '>' like ')'
+    @EXPORT = (
+        qw<
+          i Re Im rho theta arg
+          sqrt log ln
+          log10 logn cbrt root
+          cplx cplxe
+        >,
+        @trig
+    );
+
+    # but ';' not outdented
+    @EXPORT = (
+        qw;
+          i Re Im rho theta arg
+          sqrt log ln
+          log10 logn cbrt root
+          cplx cplxe
+          ;,
+        @trig
+    );
+#19...........
+        },
     };
 
     my $ntests = 0 + keys %{$rtests};