diff options
Diffstat (limited to 'systemtest/testdata/parser/gentest.awk')
-rw-r--r-- | systemtest/testdata/parser/gentest.awk | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/systemtest/testdata/parser/gentest.awk b/systemtest/testdata/parser/gentest.awk new file mode 100644 index 0000000..b743c6c --- /dev/null +++ b/systemtest/testdata/parser/gentest.awk @@ -0,0 +1,29 @@ +#! /bin/gawk -f +## +## This AWK-script generates some example queries, when applied on "testcases", +## as command line argument. When you need to add new test cases, edit the +## file "testcases". Each line in this file should be of the form: +## +## filename @ query @ -- comment @ -- comment +## +## For example the line: +## +## mm.ql @ select 2- -1 from ImgCharA as a @ -- caution: -- introduces comments. +## +## should generate a test file named mm.ql with the folowing content: +## +## -- caution: -- introduces comments. +## +## select 2- -1 from ImgCharA as a +## +## The char @ is somewhat unusual for SQL and I chose it as field separator. + +BEGIN {FS = "@"} ; + +{ + for (i = 3; i < NF; i++) { + printf "%s\n", $i > $1 + } + printf "\n" >> $1 + printf "%s\n", $2 >> $1 +} |