Denis Vlasenko | 960eca6 | 2007-07-18 18:33:18 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Denis Vlasenko | 960eca6 | 2007-07-18 18:33:18 +0000 | [diff] [blame] | 3 | # Copyright 2007 by Denys Vlasenko <vda.linux@googlemail.com> |
| 4 | # Licensed under GPL v2, see file LICENSE for details. |
| 5 | |
| 6 | . testing.sh |
| 7 | |
Denis Vlasenko | bb13079 | 2008-07-15 06:45:14 +0000 | [diff] [blame] | 8 | # testing "description" "command" "result" "infile" "stdin" |
Denis Vlasenko | 960eca6 | 2007-07-18 18:33:18 +0000 | [diff] [blame] | 9 | |
| 10 | testing "awk -F case 0" "awk -F '[#]' '{ print NF }'" "" "" "" |
| 11 | testing "awk -F case 1" "awk -F '[#]' '{ print NF }'" "0\n" "" "\n" |
| 12 | testing "awk -F case 2" "awk -F '[#]' '{ print NF }'" "2\n" "" "#\n" |
| 13 | testing "awk -F case 3" "awk -F '[#]' '{ print NF }'" "3\n" "" "#abc#\n" |
| 14 | testing "awk -F case 4" "awk -F '[#]' '{ print NF }'" "3\n" "" "#abc#zz\n" |
| 15 | testing "awk -F case 5" "awk -F '[#]' '{ print NF }'" "4\n" "" "#abc##zz\n" |
| 16 | testing "awk -F case 6" "awk -F '[#]' '{ print NF }'" "4\n" "" "z#abc##zz\n" |
| 17 | testing "awk -F case 7" "awk -F '[#]' '{ print NF }'" "5\n" "" "z##abc##zz\n" |
| 18 | |
Denis Vlasenko | 66496d7 | 2008-08-29 08:37:07 +0000 | [diff] [blame] | 19 | # 4294967295 = 0xffffffff |
| 20 | testing "awk bitwise op" "awk '{ print or(4294967295,1) }'" "4.29497e+09\n" "" "\n" |
| 21 | testing "awk hex const 1" "awk '{ print or(0xffffffff,1) }'" "4.29497e+09\n" "" "\n" |
| 22 | testing "awk hex const 2" "awk '{ print or(0x80000000,1) }'" "2.14748e+09\n" "" "\n" |
Denis Vlasenko | a2e1eea | 2008-09-02 09:00:23 +0000 | [diff] [blame] | 23 | testing "awk oct const" "awk '{ print or(01234,1) }'" "669\n" "" "\n" |
Denis Vlasenko | 66496d7 | 2008-08-29 08:37:07 +0000 | [diff] [blame] | 24 | |
Denis Vlasenko | 3bb2bbd | 2008-07-01 01:57:36 +0000 | [diff] [blame] | 25 | tar xjf awk_t1.tar.bz2 |
| 26 | testing "awk 'gcc build bug'" \ |
| 27 | "awk -f awk_t1_opt-functions.awk -f awk_t1_opth-gen.awk <awk_t1_input | md5sum" \ |
| 28 | "f842e256461a5ab1ec60b58d16f1114f -\n" \ |
| 29 | "" "" |
| 30 | rm -rf awk_t1_* |
| 31 | |
Denis Vlasenko | 960eca6 | 2007-07-18 18:33:18 +0000 | [diff] [blame] | 32 | exit $FAILCOUNT |