]> git.donarmstrong.com Git - perltidy.git/commitdiff
added tests for -sot -sct
authorSteve Hancock <perltidy@users.sourceforge.net>
Sat, 13 Jun 2020 00:49:18 +0000 (17:49 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sat, 13 Jun 2020 00:49:18 +0000 (17:49 -0700)
t/snippets/expect/sot.def [new file with mode: 0644]
t/snippets/expect/sot.sot [new file with mode: 0644]
t/snippets/packing_list.txt
t/snippets/sot.in [new file with mode: 0644]
t/snippets/sot.par [new file with mode: 0644]
t/snippets21.t

diff --git a/t/snippets/expect/sot.def b/t/snippets/expect/sot.def
new file mode 100644 (file)
index 0000000..dd5c8ca
--- /dev/null
@@ -0,0 +1,22 @@
+$opt_c = Text::CSV_XS->new(
+    {
+        binary       => 1,
+        sep_char     => $opt_c,
+        always_quote => 1,
+    }
+);
+
+$c->Tk::bind(
+    '<Control-f>' => 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 (file)
index 0000000..32bef96
--- /dev/null
@@ -0,0 +1,17 @@
+$opt_c = Text::CSV_XS->new( {
+    binary       => 1,
+    sep_char     => $opt_c,
+    always_quote => 1,
+} );
+
+$c->Tk::bind(
+    '<Control-f>' => sub {
+        my ($c) = @_;
+        my $e = $c->XEvent;
+        itemsUnderArea $c;
+    } );
+
+__PACKAGE__->load_components( qw(
+      PK::Auto
+      Core
+) );
index d21f2552d3b315817fb00ad8a0fb53d70bdb35d7..18cd2774fc52274f36bf2d4f264a0bb979696a75 100644 (file)
 ../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 (file)
index 0000000..5860082
--- /dev/null
@@ -0,0 +1,17 @@
+$opt_c = Text::CSV_XS->new(
+{
+    binary       => 1, sep_char     => $opt_c, always_quote => 1,
+}
+);
+
+$c->Tk::bind(
+'<Control-f>' => 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 (file)
index 0000000..2241da4
--- /dev/null
@@ -0,0 +1 @@
+-sot -sct
index 2eff5aa90aaa16fe793d4b5cbfd528f8763cf962..3a2c75d3e649e9aabafc0d43af888424d37285e5 100644 (file)
@@ -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(
+'<Control-f>' => 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(
+    '<Control-f>' => 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(
+    '<Control-f>' => sub {
+        my ($c) = @_;
+        my $e = $c->XEvent;
+        itemsUnderArea $c;
+    } );
+
+__PACKAGE__->load_components( qw(
+      PK::Auto
+      Core
+) );
+#5...........
+        },
     };
 
     my $ntests = 0 + keys %{$rtests};