summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanguy Pruvot2012-06-11 10:33:45 +0200
committerDenys Vlasenko2012-06-11 10:33:45 +0200
commit0a393cf7da9003d0d64e1868c13ef206af125451 (patch)
tree9296d54823d5e32a44aca4cf63af28159e209dc7
parent93c32f2dd2b9d7c06bc46be8adac704c08929da8 (diff)
downloadbusybox-0a393cf7da9003d0d64e1868c13ef206af125451.zip
busybox-0a393cf7da9003d0d64e1868c13ef206af125451.tar.gz
testsuite: some more awk tests related to conditions
Signed-off-by: Tanguy Pruvot <tanguy.pruvot@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rwxr-xr-xtestsuite/awk.tests7
1 files changed, 7 insertions, 0 deletions
diff --git a/testsuite/awk.tests b/testsuite/awk.tests
index 5a32304..e671907 100755
--- a/testsuite/awk.tests
+++ b/testsuite/awk.tests
@@ -16,6 +16,13 @@ testing "awk -F case 5" "awk -F '[#]' '{ print NF }'" "4\n" "" "#abc##zz\n"
testing "awk -F case 6" "awk -F '[#]' '{ print NF }'" "4\n" "" "z#abc##zz\n"
testing "awk -F case 7" "awk -F '[#]' '{ print NF }'" "5\n" "" "z##abc##zz\n"
+# conditions and operators
+testing "awk if operator == " "awk 'BEGIN{if(23==23) print \"foo\"}'" "foo\n" "" ""
+testing "awk if operator != " "awk 'BEGIN{if(23!=23) print \"bar\"}'" "" "" ""
+testing "awk if operator >= " "awk 'BEGIN{if(23>=23) print \"foo\"}'" "foo\n" "" ""
+testing "awk if operator < " "awk 'BEGIN{if(2 < 13) print \"foo\"}'" "foo\n" "" ""
+testing "awk if string == " "awk 'BEGIN{if(\"a\"==\"ab\") print \"bar\"}'" "" "" ""
+
# 4294967295 = 0xffffffff
testing "awk bitwise op" "awk '{ print or(4294967295,1) }'" "4.29497e+09\n" "" "\n"
optional DESKTOP