[PATCH] some more tests for awk

Tanguy Pruvot tanguy.pruvot at gmail.com
Sun Jun 3 17:18:16 UTC 2012


There is some sensible variables affectation in the evaluate loop...
I think these basic tests should be added for later... :)

From 0c5454932df1c11244746eaf3e16f9aa33498909 Mon Sep 17 00:00:00 2001
From: Tanguy Pruvot <tanguy.pruvot at gmail.com>
Date: Sun, 3 Jun 2012 17:58:23 +0200
Subject: [PATCH] testsuite: some more awk tests related to conditions

Change-Id: I6dea42f5cf50d6c1c070467be0c9e9a532d2a641
---
 testsuite/awk.tests |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/testsuite/awk.tests b/testsuite/awk.tests
index 5a32304..5d871d1 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
-- 
1.7.8.3



--
Tanguy Pruvot                         email : tanguy.pruvot at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-testsuite-some-more-awk-tests-related-to-conditions.patch
Type: application/octet-stream
Size: 1368 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20120603/0eabcc3a/attachment-0001.obj>


More information about the busybox mailing list