summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Giovanni Colombo <azc100@gmail.com>2023-04-12 11:57:44 +0200
committerAntonio Giovanni Colombo <azc100@gmail.com>2023-04-12 11:57:44 +0200
commit771503644b87700e2adbf843bb0f6b1ec2e8dc0a (patch)
treeb0b3a9c06b1452ce1b0f99b339e98a0e64c738cf
parenta566646106aaf32e9719790e300e743c3c154ab2 (diff)
downloadgawk-egtests.tar.gz
Added test for tocsv scriptegtests
-rwxr-xr-xegtests/egtest18
-rwxr-xr-x[-rw-r--r--]egtests/info.html16
-rwxr-xr-x[-rw-r--r--]egtests/info.txt16
3 files changed, 42 insertions, 8 deletions
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
index 58177752..23f89133 100644..100755
--- 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
index 041c179f..e9c9e9db 100644..100755
--- 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: