From 082b4dd899b76a56793296dfa31bc83098a4cda6 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Wed, 8 Sep 2021 06:52:44 -0700 Subject: [PATCH] add test case --- t/snippets/expect/pretok.def | 19 +++++++++--------- t/snippets/packing_list.txt | 2 +- t/snippets/pretok.in | 20 +++++++++--------- t/snippets24.t | 39 ++++++++++++++++++------------------ 4 files changed, 39 insertions(+), 41 deletions(-) diff --git a/t/snippets/expect/pretok.def b/t/snippets/expect/pretok.def index b210a069..7e84f1d5 100644 --- a/t/snippets/expect/pretok.def +++ b/t/snippets/expect/pretok.def @@ -1,11 +1,10 @@ # 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'); +my $s1 = $^? ? "def" : "not def"; +my $s2 = $^ ? "def" : "not def"; +my $s3 = $^ if ($s2); +my $s4 = $^O eq "linux"; +my $s5 = $^O ne "linux"; +my $s6 = $^O ne "linux"; +my $s7 = %^O; +my $s8 = 'hi' . 's' x 10 if (1); +my $s9 = 'merci' x 0.1e4 . $s8; diff --git a/t/snippets/packing_list.txt b/t/snippets/packing_list.txt index e411f5b4..147bab5c 100644 --- a/t/snippets/packing_list.txt +++ b/t/snippets/packing_list.txt @@ -326,6 +326,7 @@ ../snippets24.t code_skipping.def ../snippets24.t git51.def ../snippets24.t git51.git51 +../snippets24.t pretok.def ../snippets3.t ce_wn1.ce_wn ../snippets3.t ce_wn1.def ../snippets3.t colin.colin @@ -466,4 +467,3 @@ ../snippets9.t rt98902.def ../snippets9.t rt98902.rt98902 ../snippets9.t rt99961.def -../snippets24.t pretok.def diff --git a/t/snippets/pretok.in b/t/snippets/pretok.in index 874712db..eae786ac 100644 --- a/t/snippets/pretok.in +++ b/t/snippets/pretok.in @@ -1,11 +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'); +my$s1=$^??"def":"not def"; +my$s2=$^ ?"def":"not def"; +my$s3=$^if($s2); +my$s4=$^Oeq"linux"; +my$s5=$ ^One"linux"; +my$s6=$ + ^One"linux"; +my$s7=%^O; +my$s8='hi'.'s'x10if(1); +my$s9='merci'x0.1e4.$s8; diff --git a/t/snippets24.t b/t/snippets24.t index 975caa1d..f2b83778 100644 --- a/t/snippets24.t +++ b/t/snippets24.t @@ -283,16 +283,16 @@ my @vals = ( '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'); +my$s1=$^??"def":"not def"; +my$s2=$^ ?"def":"not def"; +my$s3=$^if($s2); +my$s4=$^Oeq"linux"; +my$s5=$ ^One"linux"; +my$s6=$ + ^One"linux"; +my$s7=%^O; +my$s8='hi'.'s'x10if(1); +my$s9='merci'x0.1e4.$s8; ---------- 'rt136417' => <<'----------', @@ -945,16 +945,15 @@ Type::Libraries->setup_class( 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'); +my $s1 = $^? ? "def" : "not def"; +my $s2 = $^ ? "def" : "not def"; +my $s3 = $^ if ($s2); +my $s4 = $^O eq "linux"; +my $s5 = $^O ne "linux"; +my $s6 = $^O ne "linux"; +my $s7 = %^O; +my $s8 = 'hi' . 's' x 10 if (1); +my $s9 = 'merci' x 0.1e4 . $s8; #19........... }, }; -- 2.39.5