4
while ((getline word) > 0)
7
n = asorti(dict, dictindices)
8
for (i = 1; i <= n; i++)
9
printf("dict[%s] = %s\n", dictindices[i], dict[dictindices[i]]) > "orig.out"
12
ret = writea("orig.bin", dict)
13
printf "writea() returned %d, expecting 1\n", ret
16
ret = reada("orig.bin", dict)
17
printf "reada() returned %d, expecting 1\n", ret
19
n = asorti(dict, dictindices)
20
for (i = 1; i <= n; i++)
21
printf("dict[%s] = %s\n", dictindices[i], dict[dictindices[i]]) > "new.out"
24
ret = system("cmp orig.out new.out")
27
print "old and new are equal - GOOD"
29
print "old and new are not equal - BAD"
31
if (ret == 0 && !("KEEPIT" in ENVIRON))
32
system("rm -f orig.bin orig.out new.out")