]> git.donarmstrong.com Git - perltidy.git/commitdiff
add tests for sub split_pretoken
authorSteve Hancock <perltidy@users.sourceforge.net>
Tue, 7 Sep 2021 23:19:56 +0000 (16:19 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Tue, 7 Sep 2021 23:19:56 +0000 (16:19 -0700)
t/snippets/expect/pretok.def [new file with mode: 0644]
t/snippets/packing_list.txt
t/snippets/pretok.in [new file with mode: 0644]
t/snippets24.t

diff --git a/t/snippets/expect/pretok.def b/t/snippets/expect/pretok.def
new file mode 100644 (file)
index 0000000..b210a06
--- /dev/null
@@ -0,0 +1,11 @@
+# test sub split_pretoken
+my $bb  = $^? ? "defined" : "not defined";
+my $aa  = $^ if ($bb);
+my $yes = $^O eq "linux";
+my $no  = $^O ne "linux";
+my $val = %^O;
+$str0 = 'hi' . 's' x 10 if (1);
+$str1 = 'merci' x 0.1e4 . $str0;
+$str2 = 'hi' . 's' x 10.2 . 'you';
+$str2 = 'hi' . 's' x 0.1e1;
+$str3 = 'tak' x 0 if ('bad');
index 5ea6f4e19c1a02ad1f57d36f092d7e9ae558cbc2..e411f5b427bfeb19afe4ad2bf3c9ebda9ef75f4a 100644 (file)
 ../snippets24.t        rt136417.rt136417
 ../snippets24.t        numbers.def
 ../snippets24.t        code_skipping.def
+../snippets24.t        git51.def
+../snippets24.t        git51.git51
 ../snippets3.t ce_wn1.ce_wn
 ../snippets3.t ce_wn1.def
 ../snippets3.t colin.colin
 ../snippets9.t rt98902.def
 ../snippets9.t rt98902.rt98902
 ../snippets9.t rt99961.def
-../snippets24.t        git51.def
-../snippets24.t        git51.git51
+../snippets24.t        pretok.def
diff --git a/t/snippets/pretok.in b/t/snippets/pretok.in
new file mode 100644 (file)
index 0000000..874712d
--- /dev/null
@@ -0,0 +1,11 @@
+# test sub split_pretoken
+my $bb=$^??"defined":"not defined";
+my $aa=$^if($bb);
+my $yes=$^Oeq"linux";
+my $no=$  ^One"linux";
+my $val=% ^O;
+$str0='hi'.'s'x10if(1);
+$str1='merci'x0.1e4.$str0;
+$str2='hi'.'s'x10.2.'you';
+$str2='hi'.'s'x0.1e1;
+$str3='tak'x0if('bad');
index 92aa708986c1c700f47d95d14ddfe6c9fce50f7c..975caa1d4c3c6db527ae8fc10f796f77df4a3d09 100644 (file)
@@ -19,6 +19,7 @@
 #16 code_skipping.def
 #17 git51.def
 #18 git51.git51
+#19 pretok.def
 
 # To locate test #13 you can search for its name or the string '#13'
 
@@ -278,6 +279,20 @@ my @vals = (
     0o12_345,  # optional 'o' and 'O' added in perl v5.33.5
     0O12_345,
 );
+----------
+
+        'pretok' => <<'----------',
+# test sub split_pretoken
+my $bb=$^??"defined":"not defined";
+my $aa=$^if($bb);
+my $yes=$^Oeq"linux";
+my $no=$  ^One"linux";
+my $val=% ^O;
+$str0='hi'.'s'x10if(1);
+$str1='merci'x0.1e4.$str0;
+$str2='hi'.'s'x10.2.'you';
+$str2='hi'.'s'x0.1e1;
+$str3='tak'x0if('bad');
 ----------
 
         'rt136417' => <<'----------',
@@ -924,6 +939,24 @@ Type::Libraries->setup_class(
 );
 #18...........
         },
+
+        'pretok.def' => {
+            source => "pretok",
+            params => "def",
+            expect => <<'#19...........',
+# test sub split_pretoken
+my $bb  = $^? ? "defined" : "not defined";
+my $aa  = $^ if ($bb);
+my $yes = $^O eq "linux";
+my $no  = $^O ne "linux";
+my $val = %^O;
+$str0 = 'hi' . 's' x 10 if (1);
+$str1 = 'merci' x 0.1e4 . $str0;
+$str2 = 'hi' . 's' x 10.2 . 'you';
+$str2 = 'hi' . 's' x 0.1e1;
+$str3 = 'tak' x 0 if ('bad');
+#19...........
+        },
     };
 
     my $ntests = 0 + keys %{$rtests};