3
0

awk.tests 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/sh
  2. # Copyright 2007 by Denys Vlasenko <vda.linux@googlemail.com>
  3. # Licensed under GPL v2, see file LICENSE for details.
  4. . testing.sh
  5. # testing "description" "command" "result" "infile" "stdin"
  6. testing "awk -F case 0" "awk -F '[#]' '{ print NF }'" "" "" ""
  7. testing "awk -F case 1" "awk -F '[#]' '{ print NF }'" "0\n" "" "\n"
  8. testing "awk -F case 2" "awk -F '[#]' '{ print NF }'" "2\n" "" "#\n"
  9. testing "awk -F case 3" "awk -F '[#]' '{ print NF }'" "3\n" "" "#abc#\n"
  10. testing "awk -F case 4" "awk -F '[#]' '{ print NF }'" "3\n" "" "#abc#zz\n"
  11. testing "awk -F case 5" "awk -F '[#]' '{ print NF }'" "4\n" "" "#abc##zz\n"
  12. testing "awk -F case 6" "awk -F '[#]' '{ print NF }'" "4\n" "" "z#abc##zz\n"
  13. testing "awk -F case 7" "awk -F '[#]' '{ print NF }'" "5\n" "" "z##abc##zz\n"
  14. # 4294967295 = 0xffffffff
  15. testing "awk bitwise op" "awk '{ print or(4294967295,1) }'" "4.29497e+09\n" "" "\n"
  16. testing "awk hex const 1" "awk '{ print or(0xffffffff,1) }'" "4.29497e+09\n" "" "\n"
  17. testing "awk hex const 2" "awk '{ print or(0x80000000,1) }'" "2.14748e+09\n" "" "\n"
  18. testing "awk oct const" "awk '{ print or(01234,1) }'" "669\n" "" "\n"
  19. tar xjf awk_t1.tar.bz2
  20. testing "awk 'gcc build bug'" \
  21. "awk -f awk_t1_opt-functions.awk -f awk_t1_opth-gen.awk <awk_t1_input | md5sum" \
  22. "f842e256461a5ab1ec60b58d16f1114f -\n" \
  23. "" ""
  24. rm -rf awk_t1_*
  25. exit $FAILCOUNT