diff options
| author | Constantin Jucovschi <cj@ubuntu.localdomain> | 2009-04-24 07:20:22 -0400 |
|---|---|---|
| committer | Constantin Jucovschi <cj@ubuntu.localdomain> | 2009-04-24 07:20:22 -0400 |
| commit | 8f27e65bddd7d4b8515ce620fb485fdd78fcdf89 (patch) | |
| tree | bd328a4dd4f92d32202241b5e3a7f36177792c5f /systemtest/testdata/parser/gentest.awk | |
| download | rasdaman-upstream-8.0.tar.gz rasdaman-upstream-8.0.tar.xz rasdaman-upstream-8.0.zip | |
Initial commitv8.0
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 +} |
