From: Steve Hancock Date: Sat, 13 Jun 2020 00:49:18 +0000 (-0700) Subject: added tests for -sot -sct X-Git-Tag: 20200619~5 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=1a0a3cb5c5b34958d8b973d4dade4a9ebcc870f9;p=perltidy.git added tests for -sot -sct --- diff --git a/t/snippets/expect/sot.def b/t/snippets/expect/sot.def new file mode 100644 index 00000000..dd5c8ca1 --- /dev/null +++ b/t/snippets/expect/sot.def @@ -0,0 +1,22 @@ +$opt_c = Text::CSV_XS->new( + { + binary => 1, + sep_char => $opt_c, + always_quote => 1, + } +); + +$c->Tk::bind( + '' => sub { + my ($c) = @_; + my $e = $c->XEvent; + itemsUnderArea $c; + } +); + +__PACKAGE__->load_components( + qw( + PK::Auto + Core + ) +); diff --git a/t/snippets/expect/sot.sot b/t/snippets/expect/sot.sot new file mode 100644 index 00000000..32bef96b --- /dev/null +++ b/t/snippets/expect/sot.sot @@ -0,0 +1,17 @@ +$opt_c = Text::CSV_XS->new( { + binary => 1, + sep_char => $opt_c, + always_quote => 1, +} ); + +$c->Tk::bind( + '' => sub { + my ($c) = @_; + my $e = $c->XEvent; + itemsUnderArea $c; + } ); + +__PACKAGE__->load_components( qw( + PK::Auto + Core +) ); diff --git a/t/snippets/packing_list.txt b/t/snippets/packing_list.txt index d21f2552..18cd2774 100644 --- a/t/snippets/packing_list.txt +++ b/t/snippets/packing_list.txt @@ -394,3 +394,5 @@ ../snippets9.t rt98902.def ../snippets9.t rt98902.rt98902 ../snippets9.t rt99961.def +../snippets21.t sot.def +../snippets21.t sot.sot diff --git a/t/snippets/sot.in b/t/snippets/sot.in new file mode 100644 index 00000000..58600826 --- /dev/null +++ b/t/snippets/sot.in @@ -0,0 +1,17 @@ +$opt_c = Text::CSV_XS->new( +{ + binary => 1, sep_char => $opt_c, always_quote => 1, +} +); + +$c->Tk::bind( +'' => sub { +my ($c) = @_; +my $e = $c->XEvent; +itemsUnderArea $c; +} ); + +__PACKAGE__->load_components( qw( +PK::Auto +Core +) ); diff --git a/t/snippets/sot.par b/t/snippets/sot.par new file mode 100644 index 00000000..2241da4f --- /dev/null +++ b/t/snippets/sot.par @@ -0,0 +1 @@ +-sot -sct diff --git a/t/snippets21.t b/t/snippets21.t index 2eff5aa9..3a2c75d3 100644 --- a/t/snippets21.t +++ b/t/snippets21.t @@ -4,6 +4,8 @@ #1 lop.lop #2 switch_plain.def #3 switch_plain.switch_plain +#4 sot.def +#5 sot.sot # To locate test #13 you can search for its name or the string '#13' @@ -23,6 +25,7 @@ BEGIN { $rparams = { 'def' => "", 'lop' => "-nlop", + 'sot' => "-sot -sct", 'switch_plain' => "-nola", }; @@ -51,6 +54,26 @@ lc( $self->mime_attr('content-type') || 'text/plain' ); ---------- + 'sot' => <<'----------', +$opt_c = Text::CSV_XS->new( +{ + binary => 1, sep_char => $opt_c, always_quote => 1, +} +); + +$c->Tk::bind( +'' => sub { +my ($c) = @_; +my $e = $c->XEvent; +itemsUnderArea $c; +} ); + +__PACKAGE__->load_components( qw( +PK::Auto +Core +) ); +---------- + 'switch_plain' => <<'----------', # run with -nola to keep default from outdenting use Switch::Plain; @@ -169,6 +192,59 @@ $r = $test : 'not ok'; #3........... }, + + 'sot.def' => { + source => "sot", + params => "def", + expect => <<'#4...........', +$opt_c = Text::CSV_XS->new( + { + binary => 1, + sep_char => $opt_c, + always_quote => 1, + } +); + +$c->Tk::bind( + '' => sub { + my ($c) = @_; + my $e = $c->XEvent; + itemsUnderArea $c; + } +); + +__PACKAGE__->load_components( + qw( + PK::Auto + Core + ) +); +#4........... + }, + + 'sot.sot' => { + source => "sot", + params => "sot", + expect => <<'#5...........', +$opt_c = Text::CSV_XS->new( { + binary => 1, + sep_char => $opt_c, + always_quote => 1, +} ); + +$c->Tk::bind( + '' => sub { + my ($c) = @_; + my $e = $c->XEvent; + itemsUnderArea $c; + } ); + +__PACKAGE__->load_components( qw( + PK::Auto + Core +) ); +#5........... + }, }; my $ntests = 0 + keys %{$rtests};