From: Tanguy Pruvot Date: Mon, 11 Jun 2012 08:33:45 +0000 (+0200) Subject: testsuite: some more awk tests related to conditions X-Git-Tag: 1_21_0~145 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0a393cf7da9003d0d64e1868c13ef206af125451;p=oweals%2Fbusybox.git testsuite: some more awk tests related to conditions Signed-off-by: Tanguy Pruvot Signed-off-by: Denys Vlasenko --- diff --git a/testsuite/awk.tests b/testsuite/awk.tests index 5a323047d..e67190757 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