From 771503644b87700e2adbf843bb0f6b1ec2e8dc0a Mon Sep 17 00:00:00 2001 From: Antonio Giovanni Colombo Date: Wed, 12 Apr 2023 11:57:44 +0200 Subject: Added test for tocsv script --- egtests/egtest | 18 ++++++++++++++++++ egtests/info.html | 16 ++++++++++++---- egtests/info.txt | 16 ++++++++++++---- 3 files changed, 42 insertions(+), 8 deletions(-) mode change 100644 => 100755 egtests/info.html mode change 100644 => 100755 egtests/info.txt diff --git a/egtests/egtest b/egtests/egtest index 9e41fec8..db62aab9 100755 --- a/egtests/egtest +++ b/egtests/egtest @@ -671,6 +671,24 @@ do_testbits() { # gawk -f testbits.awk -f bits2str.awk } +do_tocsv() { + echo "*" + echo "echo \"{ csvline=tocsv_rec(\",\")\" >$testpgm" + echo "{ csvline=tocsv_rec(\",\")" >$testpgm + echo "echo \"print \"BEFORE\",\$0\" >>$testpgm" + echo "print \"BEFORE\",\$0" >>$testpgm + echo "echo \"print \"AFTER \",csvline }\" >>$testpgm" + echo "print \"AFTER \",csvline }" >>$testpgm + echo "* test data" + printf "p,\"q,r\",s\np,\"q\"\"r\",s\np,\"q,\"\"r\",s\np,\"\",s\np,,s\n" >$testdata + echo "cat $testdata" + cat $testdata + echo "*" + echo "gawk -f tocsv.awk -f $testpgm $testdata" + gawk -f tocsv.awk -f $testpgm $testdata + echo "*" +} + do_translate() { echo "*" echo "input:" diff --git a/egtests/info.html b/egtests/info.html old mode 100644 new mode 100755 index 58177752..23f89133 --- a/egtests/info.html +++ b/egtests/info.html @@ -46,7 +46,7 @@ egtest [it] The script extracts both the original English and the Italian programs/scripts from the Gawk book. -Only the programs/scripta in the selected language +Only the programs/scripts in the selected language are tested, but it is possible to compare each of them with the corresponding program/script in the other language. @@ -59,9 +59,17 @@ egtests directory during the test. The gawkeg script needs a number of pieces of software, in order to test gawk extensions, etc. -Namely: -[to be completed] - +It works only in a Linux/Unix environment, and requires: +the "gcc" compiler +the "cat" command +the "echo" command +the "grep" command +the "head" command +the "history" command +the "msgfmt" command +the "tail" command +the "vim" and "vimdiff" commands +the "/usr/share/dict/words" file After calling egtest, the following prompt is visualized: diff --git a/egtests/info.txt b/egtests/info.txt old mode 100644 new mode 100755 index 041c179f..e9c9e9db --- a/egtests/info.txt +++ b/egtests/info.txt @@ -26,7 +26,7 @@ egtest [it] The script extracts both the original English and the Italian programs/scripts from the Gawk book. -Only the programs/scripta in the selected language +Only the programs/scripts in the selected language are tested, but it is possible to compare each of them with the corresponding program/script in the other language. @@ -39,9 +39,17 @@ egtests directory during the test. The gawkeg script needs a number of pieces of software, in order to test gawk extensions, etc. -Namely: -[to be completed] - +It works only in a Linux/Unix environment, and requires: +the "gcc" compiler +the "cat" command +the "echo" command +the "grep" command +the "head" command +the "history" command +the "msgfmt" command +the "tail" command +the "vim" and "vimdiff" commands +the "/usr/share/dict/words" file After calling egtest, the following prompt is visualized: -- cgit v1.2.1