From 6efe8e3230fd8bee309a68d4fc617d682dfaaf3e Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Thu, 8 Oct 2020 21:14:43 -0700 Subject: [PATCH] added test cases for -xci --- t/snippets/expect/xci.def | 22 +++++++ t/snippets/expect/xci.xci1 | 22 +++++++ t/snippets/expect/xci.xci2 | 20 +++++++ t/snippets/packing_list.txt | 5 +- t/snippets/xci.in | 22 +++++++ t/snippets/xci1.par | 1 + t/snippets/xci2.par | 1 + t/snippets22.t | 115 ++++++++++++++++++++++++++++++++++++ 8 files changed, 207 insertions(+), 1 deletion(-) create mode 100644 t/snippets/expect/xci.def create mode 100644 t/snippets/expect/xci.xci1 create mode 100644 t/snippets/expect/xci.xci2 create mode 100644 t/snippets/xci.in create mode 100644 t/snippets/xci1.par create mode 100644 t/snippets/xci2.par diff --git a/t/snippets/expect/xci.def b/t/snippets/expect/xci.def new file mode 100644 index 00000000..cde75b91 --- /dev/null +++ b/t/snippets/expect/xci.def @@ -0,0 +1,22 @@ +$self->{_text} = ( + !$section ? '' + : $type eq 'item' ? "the $section entry" + : "the section on $section" + ) + . ( + $page + ? ( $section ? ' in ' : '' ) . "the $page$page_ext manpage" + : ' elsewhere in this document' + ); + +my $otherHashRef = + $condition + ? { + 'a' => 'a value', + 'b' => 'b value', + 'c' => { + 'd' => 'd value', + 'e' => 'e value' + } + } + : undef; diff --git a/t/snippets/expect/xci.xci1 b/t/snippets/expect/xci.xci1 new file mode 100644 index 00000000..6550b9af --- /dev/null +++ b/t/snippets/expect/xci.xci1 @@ -0,0 +1,22 @@ +$self->{_text} = ( + !$section ? '' + : $type eq 'item' ? "the $section entry" + : "the section on $section" + ) + . ( + $page + ? ( $section ? ' in ' : '' ) . "the $page$page_ext manpage" + : ' elsewhere in this document' + ); + +my $otherHashRef = + $condition + ? { + 'a' => 'a value', + 'b' => 'b value', + 'c' => { + 'd' => 'd value', + 'e' => 'e value' + } + } + : undef; diff --git a/t/snippets/expect/xci.xci2 b/t/snippets/expect/xci.xci2 new file mode 100644 index 00000000..24c19b63 --- /dev/null +++ b/t/snippets/expect/xci.xci2 @@ -0,0 +1,20 @@ +$self->{_text} = ( + !$section ? '' + : $type eq 'item' ? "the $section entry" + : "the section on $section" + ) + . ( $page + ? ( $section ? ' in ' : '' ) . "the $page$page_ext manpage" + : ' elsewhere in this document' + ); + +my $otherHashRef + = $condition + ? { 'a' => 'a value', + 'b' => 'b value', + 'c' => { + 'd' => 'd value', + 'e' => 'e value' + } + } + : undef; diff --git a/t/snippets/packing_list.txt b/t/snippets/packing_list.txt index 77ce0f80..18becc13 100644 --- a/t/snippets/packing_list.txt +++ b/t/snippets/packing_list.txt @@ -276,6 +276,7 @@ ../snippets22.t bbhb.def ../snippets22.t bbhb.bbhb4 ../snippets22.t bbhb.bbhb5 +../snippets22.t braces.braces7 ../snippets3.t ce_wn1.ce_wn ../snippets3.t ce_wn1.def ../snippets3.t colin.colin @@ -416,4 +417,6 @@ ../snippets9.t rt98902.def ../snippets9.t rt98902.rt98902 ../snippets9.t rt99961.def -../snippets22.t braces.braces7 +../snippets22.t xci.def +../snippets22.t xci.xci1 +../snippets22.t xci.xci2 diff --git a/t/snippets/xci.in b/t/snippets/xci.in new file mode 100644 index 00000000..a51e55ef --- /dev/null +++ b/t/snippets/xci.in @@ -0,0 +1,22 @@ +$self->{_text} = ( + !$section ? '' + : $type eq 'item' ? "the $section entry" + : "the section on $section" + ) + . ( + $page + ? ( $section ? ' in ' : '' ) . "the $page$page_ext manpage" + : ' elsewhere in this document' + ); + +my $otherHashRef = + $condition + ? { + 'a' => 'a value', + 'b' => 'b value', + 'c' => { + 'd' => 'd value', + 'e' => 'e value' + } + } + : undef; diff --git a/t/snippets/xci1.par b/t/snippets/xci1.par new file mode 100644 index 00000000..3b83a56b --- /dev/null +++ b/t/snippets/xci1.par @@ -0,0 +1 @@ +-xci diff --git a/t/snippets/xci2.par b/t/snippets/xci2.par new file mode 100644 index 00000000..5c9e8cdf --- /dev/null +++ b/t/snippets/xci2.par @@ -0,0 +1 @@ +-pbp -nst -nse -xci diff --git a/t/snippets22.t b/t/snippets22.t index fd5bf86a..c36c9806 100644 --- a/t/snippets22.t +++ b/t/snippets22.t @@ -8,6 +8,9 @@ #5 bbhb.bbhb4 #6 bbhb.bbhb5 #7 braces.braces7 +#8 xci.def +#9 xci.xci1 +#10 xci.xci2 # To locate test #13 you can search for its name or the string '#13' @@ -34,6 +37,8 @@ BEGIN { ---------- 'def' => "", 'here_long' => "-l=33", + 'xci1' => "-xci", + 'xci2' => "-pbp -nst -nse -xci", }; ############################ @@ -109,6 +114,31 @@ $sth= $dbh->prepare (<<"END_OF_SELECT") or die "Couldn't prepare SQL" ; FROM logins WHERE username='$user' END_OF_SELECT +---------- + + 'xci' => <<'----------', +$self->{_text} = ( + !$section ? '' + : $type eq 'item' ? "the $section entry" + : "the section on $section" + ) + . ( + $page + ? ( $section ? ' in ' : '' ) . "the $page$page_ext manpage" + : ' elsewhere in this document' + ); + +my $otherHashRef = + $condition + ? { + 'a' => 'a value', + 'b' => 'b value', + 'c' => { + 'd' => 'd value', + 'e' => 'e value' + } + } + : undef; ---------- }; @@ -275,6 +305,91 @@ catch }; #7........... }, + + 'xci.def' => { + source => "xci", + params => "def", + expect => <<'#8...........', +$self->{_text} = ( + !$section ? '' + : $type eq 'item' ? "the $section entry" + : "the section on $section" + ) + . ( + $page + ? ( $section ? ' in ' : '' ) . "the $page$page_ext manpage" + : ' elsewhere in this document' + ); + +my $otherHashRef = + $condition + ? { + 'a' => 'a value', + 'b' => 'b value', + 'c' => { + 'd' => 'd value', + 'e' => 'e value' + } + } + : undef; +#8........... + }, + + 'xci.xci1' => { + source => "xci", + params => "xci1", + expect => <<'#9...........', +$self->{_text} = ( + !$section ? '' + : $type eq 'item' ? "the $section entry" + : "the section on $section" + ) + . ( + $page + ? ( $section ? ' in ' : '' ) . "the $page$page_ext manpage" + : ' elsewhere in this document' + ); + +my $otherHashRef = + $condition + ? { + 'a' => 'a value', + 'b' => 'b value', + 'c' => { + 'd' => 'd value', + 'e' => 'e value' + } + } + : undef; +#9........... + }, + + 'xci.xci2' => { + source => "xci", + params => "xci2", + expect => <<'#10...........', +$self->{_text} = ( + !$section ? '' + : $type eq 'item' ? "the $section entry" + : "the section on $section" + ) + . ( $page + ? ( $section ? ' in ' : '' ) . "the $page$page_ext manpage" + : ' elsewhere in this document' + ); + +my $otherHashRef + = $condition + ? { 'a' => 'a value', + 'b' => 'b value', + 'c' => { + 'd' => 'd value', + 'e' => 'e value' + } + } + : undef; +#10........... + }, }; my $ntests = 0 + keys %{$rtests}; -- 2.39.5