From a60bcc4dfedf29a659af1624b7ba29e6c09e18fe Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Thu, 2 Apr 2020 07:36:16 -0700 Subject: [PATCH] fix test wn7 for rule adjustment --- t/snippets/expect/wn7.def | 6 ++---- t/snippets/expect/wn7.wn | 6 ++---- t/snippets/wn7.in | 9 +++------ t/snippets17.t | 21 +++++++-------------- 4 files changed, 14 insertions(+), 28 deletions(-) diff --git a/t/snippets/expect/wn7.def b/t/snippets/expect/wn7.def index 0e8c9923..c2618e3b 100644 --- a/t/snippets/expect/wn7.def +++ b/t/snippets/expect/wn7.def @@ -1,9 +1,7 @@ - # illustrate wn rule 2b: do not weld to opening hash brace - # if closing brace is not >=2 lines away + # do not weld paren to opening one-line non-paren container $Self->_Add( $SortOrderDisplay{ $Field->GenerateFieldForSelectSQL() } ); - # rule 2a forerly applied to all blocks, but now only - # applies to subs, so this weld is now okay with -wn + # this weld is now okay with -wn f( do { 1; !!( my $x = bless [] ); } ); diff --git a/t/snippets/expect/wn7.wn b/t/snippets/expect/wn7.wn index 0e8c9923..c2618e3b 100644 --- a/t/snippets/expect/wn7.wn +++ b/t/snippets/expect/wn7.wn @@ -1,9 +1,7 @@ - # illustrate wn rule 2b: do not weld to opening hash brace - # if closing brace is not >=2 lines away + # do not weld paren to opening one-line non-paren container $Self->_Add( $SortOrderDisplay{ $Field->GenerateFieldForSelectSQL() } ); - # rule 2a forerly applied to all blocks, but now only - # applies to subs, so this weld is now okay with -wn + # this weld is now okay with -wn f( do { 1; !!( my $x = bless [] ); } ); diff --git a/t/snippets/wn7.in b/t/snippets/wn7.in index 198d790b..c16f5298 100644 --- a/t/snippets/wn7.in +++ b/t/snippets/wn7.in @@ -1,10 +1,7 @@ - # illustrate wn rule 2b: do not weld to opening hash brace - # if closing brace is not >=2 lines away - $Self->_Add($SortOrderDisplay{$Field - ->GenerateFieldForSelectSQL()}); + # do not weld paren to opening one-line non-paren container + $Self->_Add($SortOrderDisplay{$Field->GenerateFieldForSelectSQL()}); - # rule 2a forerly applied to all blocks, but now only - # applies to subs, so this weld is now okay with -wn + # this weld is now okay with -wn f( do { 1; !!(my $x = bless []); } ); diff --git a/t/snippets17.t b/t/snippets17.t index 15aac77f..2623786e 100644 --- a/t/snippets17.t +++ b/t/snippets17.t @@ -87,13 +87,10 @@ my $subref = sub ( $cat, $id = do { state $auto_id = 0; $auto_id++ } ) { ---------- 'wn7' => <<'----------', - # illustrate wn rule 2b: do not weld to opening hash brace - # if closing brace is not >=2 lines away - $Self->_Add($SortOrderDisplay{$Field - ->GenerateFieldForSelectSQL()}); + # do not weld paren to opening one-line non-paren container + $Self->_Add($SortOrderDisplay{$Field->GenerateFieldForSelectSQL()}); - # rule 2a forerly applied to all blocks, but now only - # applies to subs, so this weld is now okay with -wn + # this weld is now okay with -wn f( do { 1; !!(my $x = bless []); } ); @@ -223,14 +220,12 @@ sub foo_subroutine_in_main { source => "wn7", params => "def", expect => <<'#6...........', - # illustrate wn rule 2b: do not weld to opening hash brace - # if closing brace is not >=2 lines away + # do not weld paren to opening one-line non-paren container $Self->_Add( $SortOrderDisplay{ $Field->GenerateFieldForSelectSQL() } ); - # rule 2a forerly applied to all blocks, but now only - # applies to subs, so this weld is now okay with -wn + # this weld is now okay with -wn f( do { 1; !!( my $x = bless [] ); } ); #6........... }, @@ -239,14 +234,12 @@ sub foo_subroutine_in_main { source => "wn7", params => "wn", expect => <<'#7...........', - # illustrate wn rule 2b: do not weld to opening hash brace - # if closing brace is not >=2 lines away + # do not weld paren to opening one-line non-paren container $Self->_Add( $SortOrderDisplay{ $Field->GenerateFieldForSelectSQL() } ); - # rule 2a forerly applied to all blocks, but now only - # applies to subs, so this weld is now okay with -wn + # this weld is now okay with -wn f( do { 1; !!( my $x = bless [] ); } ); #7........... }, -- 2.39.5