Skip to content

Commit

Permalink
tsv-select --line-buffered unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jondegenhardt committed Mar 5, 2021
1 parent 9d4b110 commit 3e46d6e
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
50 changes: 50 additions & 0 deletions tsv-select/tests/gold/basic_tests_1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,56 @@ r1c20 r1c19 r1c18 r1c17 r1c16 r1c15 r1c14 r1c13 r1c12 r1c5 r1c2
濡れ羽色 ab*56 ab.56 ab,56 ab/56 ab\56 ab-56 ab 56 ab:56 56*7 56.7 56,7 56/7 56\7 56-7 56 7 56:7 01 1 ab*c ab.c ab,c ab/c ab\c ab-c ab c ab:c
r1c26 r1c25 r1c24 r1c23 r1c22 r1c21 r1c20 r1c19 r1c18 r1c17 r1c16 r1c15 r1c14 r1c13 r1c12 r1c11 r1c10 r1c9 r1c8 r1c7 r1c6 r1c5 r1c4 r1c3 r1c2 r1c1 r1c0

line-buffered tests
-------------------

====[tsv-select --line-buffered --fields 1 input1.tsv]====
f1
1

3
4
5
6
7
8

====[tsv-select --line-buffered -e 2,3,5 -f 4,1 input1.tsv]====
f4 f1
101 1
5734
7 3
4
1367 5
f23-empty 6
f23-space 7
1931 8

====[tsv-select --line-buffered -f 1 --delimiter ^ input_2plus_hat_delim.tsv]====
f1
abc


123


====[tsv-select --line-buffered -f 1 input_emptyfile.tsv]====

====[tsv-select --line-buffered -H -f 1 input_emptyfile.tsv]====

====[tsv-select --line-buffered --header -f 1 input_header1.tsv]====
field1
11567
21567

====[tsv-select --line-buffered -H -f field2 input_header1.tsv input_header2.tsv input_header3.tsv input_header4.tsv]====
field2
12567
22567
12987
12888
22888

Help and Version printing 1
-----------------

Expand Down
11 changes: 11 additions & 0 deletions tsv-select/tests/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,17 @@ ${prog} -H input_header_variants.tsv -f 'ab\-56-56\-7,ab\,c,ab\-c' >> ${basic_te
echo "" >> ${basic_tests_1}; echo "====[tsv-select -H input_header_variants.tsv -f '濡れ羽色-ab\*56,ab.56-ab\,56,ab/56-ab\\56,ab\-56-ab\ 56,ab\:56-56\*7,56.7-56\,7,56/7-56\\7,56\-7-56\ 7,56\:7-\01,\1-ab\*c,ab\.c-ab\,c,ab/c-ab\\c,ab\-c-ab\ c,ab\:c']===" >> ${basic_tests_1}
${prog} -H input_header_variants.tsv -f '濡れ羽色-ab\*56,ab.56-ab\,56,ab/56-ab\\56,ab\-56-ab\ 56,ab\:56-56\*7,56.7-56\,7,56/7-56\\7,56\-7-56\ 7,56\:7-\01,\1-ab\*c,ab\.c-ab\,c,ab/c-ab\\c,ab\-c-ab\ c,ab\:c' >> ${basic_tests_1} 2>&1

echo "" >> ${basic_tests_1}
echo "line-buffered tests" >> ${basic_tests_1}
echo "-------------------" >> ${basic_tests_1}
runtest ${prog} "--line-buffered --fields 1 input1.tsv" ${basic_tests_1}
runtest ${prog} "--line-buffered -e 2,3,5 -f 4,1 input1.tsv" ${basic_tests_1}
runtest ${prog} "--line-buffered -f 1 --delimiter ^ input_2plus_hat_delim.tsv" ${basic_tests_1}
runtest ${prog} "--line-buffered -f 1 input_emptyfile.tsv" ${basic_tests_1}
runtest ${prog} "--line-buffered -H -f 1 input_emptyfile.tsv" ${basic_tests_1}
runtest ${prog} "--line-buffered --header -f 1 input_header1.tsv" ${basic_tests_1}
runtest ${prog} "--line-buffered -H -f field2 input_header1.tsv input_header2.tsv input_header3.tsv input_header4.tsv" ${basic_tests_1}

## Help and Version printing

echo "" >> ${basic_tests_1}
Expand Down

0 comments on commit 3e46d6e

Please sign in to comment.