From 6ac8c862e131e624bc86423512ffc4f091646eec Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Sun, 27 Dec 2020 06:48:24 -0800 Subject: [PATCH] added tests for changes in qw formatting --- t/snippets/expect/qw.def | 41 ++++++++++++++++ t/snippets/packing_list.txt | 1 + t/snippets/qw.in | 41 ++++++++++++++++ t/snippets23.t | 93 +++++++++++++++++++++++++++++++++++++ 4 files changed, 176 insertions(+) create mode 100644 t/snippets/expect/qw.def create mode 100644 t/snippets/qw.in diff --git a/t/snippets/expect/qw.def b/t/snippets/expect/qw.def new file mode 100644 index 00000000..a658d1b0 --- /dev/null +++ b/t/snippets/expect/qw.def @@ -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 + ); diff --git a/t/snippets/packing_list.txt b/t/snippets/packing_list.txt index ac76c9c0..78559e5b 100644 --- a/t/snippets/packing_list.txt +++ b/t/snippets/packing_list.txt @@ -447,3 +447,4 @@ ../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 index 00000000..399158b0 --- /dev/null +++ b/t/snippets/qw.in @@ -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 + ); diff --git a/t/snippets23.t b/t/snippets23.t index 8d7e6a5b..2e4d0915 100644 --- a/t/snippets23.t +++ b/t/snippets23.t @@ -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}; -- 2.39.5