aboutsummaryrefslogtreecommitdiffstats
path: root/test/functab4.awk
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-09-05 08:31:38 +0300
committerArnold D. Robbins <arnold@skeeve.com>2014-09-05 08:31:38 +0300
commit16a26e063e9c62bff0478fa210d875c4eed2b7c0 (patch)
tree1e2732934037e2c2758734e6ce61f93de4b80c8a /test/functab4.awk
parent8beb9796b17b6ca48eb62df8fd3d31421e43c761 (diff)
downloadegawk-16a26e063e9c62bff0478fa210d875c4eed2b7c0.tar.gz
egawk-16a26e063e9c62bff0478fa210d875c4eed2b7c0.tar.bz2
egawk-16a26e063e9c62bff0478fa210d875c4eed2b7c0.zip
Portability fix for functab4 test.
Diffstat (limited to 'test/functab4.awk')
-rw-r--r--test/functab4.awk26
1 files changed, 21 insertions, 5 deletions
diff --git a/test/functab4.awk b/test/functab4.awk
index 0d9d4267..196fcc6d 100644
--- a/test/functab4.awk
+++ b/test/functab4.awk
@@ -6,9 +6,25 @@ function foo()
}
BEGIN {
- x = FUNCTAB["chdir"]
- print "x =", x
- @x("/tmp")
- printf "we are now in --> "
- system("/bin/pwd || /usr/bin/pwd")
+ f = FUNCTAB["foo"]
+ @f()
+
+ ret1 = stat(".", data1)
+ print "ret1 =", ret1
+
+ f = "stat"
+ ret2 = @f(".", data2)
+ print "ret2 =", ret2
+
+ problem = 0
+ for (i in data1) {
+ if (! isarray(data1[i])) {
+# print i, data1[i]
+ if (! (i in data2) || data1[i] != data2[i]) {
+ printf("mismatch element \"%s\"\n", i)
+ problems++
+ }
+ }
+ }
+ print(problems ? (problems+0) "encountered" : "no problems encountered")
}