From 3068092364192c4d36215884fa0c903fca8835a2 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Tue, 23 Nov 2021 17:10:01 -0800 Subject: [PATCH] add test for -xlp --- CHANGES.md | 8 +++++ t/snippets/expect/xlp1.def | 15 +++++++++ t/snippets/expect/xlp1.xlp1 | 16 +++++++++ t/snippets/packing_list.txt | 6 ++-- t/snippets/xlp1.in | 15 +++++++++ t/snippets/xlp1.par | 1 + t/snippets25.t | 66 +++++++++++++++++++++++++++++++++++++ 7 files changed, 125 insertions(+), 2 deletions(-) create mode 100644 t/snippets/expect/xlp1.def create mode 100644 t/snippets/expect/xlp1.xlp1 create mode 100644 t/snippets/xlp1.in create mode 100644 t/snippets/xlp1.par diff --git a/CHANGES.md b/CHANGES.md index b0d7f90c..ba1e0358 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,14 @@ ## 2021 10 29.01 + - A new flag -xlp has been added which can be set to avoid most of the + limitations of the -lp flag regarding side comments, blank lines, and + code blocks. This is off by default to avoid changing existing coding, + so this flag has to be set to turn this feature on. [Documentation still + needs to be written]. It will be included in the next release to CPAN, + but some details regarding how it handles very long lines may change before + the final release to CPAN. This fixes issues git #64 and git #74. + - The coding for the -lp flag has been rewritten to avoid some problems and limitations. The new coding allows the -lp indentation style to mix smoothly with the standard indentation in a single file. Some problems diff --git a/t/snippets/expect/xlp1.def b/t/snippets/expect/xlp1.def new file mode 100644 index 00000000..bc1362ef --- /dev/null +++ b/t/snippets/expect/xlp1.def @@ -0,0 +1,15 @@ +# test -xlp with comments, broken sub blocks, blank line, line length limit +$cb1 = $act_page->Checkbutton( + -text => M "Verwenden", + -variable => \$qualitaet_s_optimierung, + -command => sub { + change_state_all( $act_page1, $qualitaet_s_optimierung, { $cb1 => 1 } ) + ; # sc + }, +)->grid( + + # block comment + -row => $gridy++, + -column => 2, + -sticky => 'e' +); diff --git a/t/snippets/expect/xlp1.xlp1 b/t/snippets/expect/xlp1.xlp1 new file mode 100644 index 00000000..2939d75d --- /dev/null +++ b/t/snippets/expect/xlp1.xlp1 @@ -0,0 +1,16 @@ +# test -xlp with comments, broken sub blocks, blank line, line length limit +$cb1 = $act_page->Checkbutton( + -text => M "Verwenden", + -variable => \$qualitaet_s_optimierung, + -command => sub { + change_state_all( $act_page1, + $qualitaet_s_optimierung, + { $cb1 => 1 } ); # sc + }, +)->grid( + + # block comment + -row => $gridy++, + -column => 2, + -sticky => 'e' +); diff --git a/t/snippets/packing_list.txt b/t/snippets/packing_list.txt index dba3830e..a042024b 100644 --- a/t/snippets/packing_list.txt +++ b/t/snippets/packing_list.txt @@ -334,6 +334,8 @@ ../snippets25.t lp2.def ../snippets25.t lp2.lp ../snippets25.t braces.braces8 +../snippets25.t rt140025.def +../snippets25.t rt140025.rt140025 ../snippets3.t ce_wn1.ce_wn ../snippets3.t ce_wn1.def ../snippets3.t colin.colin @@ -474,5 +476,5 @@ ../snippets9.t rt98902.def ../snippets9.t rt98902.rt98902 ../snippets9.t rt99961.def -../snippets25.t rt140025.def -../snippets25.t rt140025.rt140025 +../snippets25.t xlp1.def +../snippets25.t xlp1.xlp1 diff --git a/t/snippets/xlp1.in b/t/snippets/xlp1.in new file mode 100644 index 00000000..4cde71e3 --- /dev/null +++ b/t/snippets/xlp1.in @@ -0,0 +1,15 @@ +# test -xlp with comments, broken sub blocks, blank line, line length limit +$cb1 = $act_page->Checkbutton( + -text => M "Verwenden", + -variable => \$qualitaet_s_optimierung, + -command => sub { + change_state_all( $act_page1, $qualitaet_s_optimierung, { $cb1 => 1 } ) + ; # sc + }, +)->grid( + + # block comment + -row => $gridy++, + -column => 2, + -sticky => 'e' +); diff --git a/t/snippets/xlp1.par b/t/snippets/xlp1.par new file mode 100644 index 00000000..7e1f66c9 --- /dev/null +++ b/t/snippets/xlp1.par @@ -0,0 +1 @@ +-xlp diff --git a/t/snippets25.t b/t/snippets25.t index 79f0a805..71e782c4 100644 --- a/t/snippets25.t +++ b/t/snippets25.t @@ -10,6 +10,8 @@ #7 braces.braces8 #8 rt140025.def #9 rt140025.rt140025 +#10 xlp1.def +#11 xlp1.xlp1 # To locate test #13 you can search for its name or the string '#13' @@ -36,6 +38,7 @@ BEGIN { 'novalign2' => "-nvsc -nvbc -msc=2", 'novalign3' => "-nvc", 'rt140025' => "-lp -xci -ci=4 -ce", + 'xlp1' => "-xlp", }; ############################ @@ -142,6 +145,24 @@ my $cmd; } } }; +---------- + + 'xlp1' => <<'----------', +# test -xlp with comments, broken sub blocks, blank line, line length limit +$cb1 = $act_page->Checkbutton( + -text => M "Verwenden", + -variable => \$qualitaet_s_optimierung, + -command => sub { + change_state_all( $act_page1, $qualitaet_s_optimierung, { $cb1 => 1 } ) + ; # sc + }, +)->grid( + + # block comment + -row => $gridy++, + -column => 2, + -sticky => 'e' +); ---------- }; @@ -371,6 +392,51 @@ FORK: { }; #9........... }, + + 'xlp1.def' => { + source => "xlp1", + params => "def", + expect => <<'#10...........', +# test -xlp with comments, broken sub blocks, blank line, line length limit +$cb1 = $act_page->Checkbutton( + -text => M "Verwenden", + -variable => \$qualitaet_s_optimierung, + -command => sub { + change_state_all( $act_page1, $qualitaet_s_optimierung, { $cb1 => 1 } ) + ; # sc + }, +)->grid( + + # block comment + -row => $gridy++, + -column => 2, + -sticky => 'e' +); +#10........... + }, + + 'xlp1.xlp1' => { + source => "xlp1", + params => "xlp1", + expect => <<'#11...........', +# test -xlp with comments, broken sub blocks, blank line, line length limit +$cb1 = $act_page->Checkbutton( + -text => M "Verwenden", + -variable => \$qualitaet_s_optimierung, + -command => sub { + change_state_all( $act_page1, + $qualitaet_s_optimierung, + { $cb1 => 1 } ); # sc + }, +)->grid( + + # block comment + -row => $gridy++, + -column => 2, + -sticky => 'e' +); +#11........... + }, }; my $ntests = 0 + keys %{$rtests}; -- 2.39.5