shithub: kwa

Download patch

ref: 0e21daeb990191793cea556ab63fd68e7b3b48ec
parent: c6bb881fc7f0afbade038476b26e1418fa9f6706
author: qwx <qwx@sciops.net>
date: Sat Oct 11 08:08:49 EDT 2025

test/T.expr: keep results around

--- a/test/T.expr
+++ b/test/T.expr
@@ -16,7 +16,7 @@
 	printf("%3d  %s\n", nt, prog)
 	prog = sprintf("%s -F''\\t'' ''%s''", awk, prog)
 	# print "prog is", prog
-	nt2 = 0
+	nt2 = 1
 	while (getline > 0) {
 		if (NF == 0)	# blank line terminates a sequence
 			break
@@ -23,21 +23,22 @@
 		input = $1
 		for (i = 2; i < NF; i++)	# input data
 			input = input "\t" $i
-		test = sprintf("echo ''%s'' | %s >foo1; ",
+		test = sprintf("echo ''%s'' | %s >foo1."nt"."nt2"; ",
 			input, prog)
 		if ($NF == "\"\"")
-			output = ">foo2;"
+			output = ">foo2."nt"."nt2";"
 		else
-			output = sprintf("echo ''%s'' >foo2; ", $NF)
+			output = sprintf("echo ''%s'' >foo2."nt"."nt2"; ", $NF)
 		gsub(/\\t/, "\t", output)
 		gsub(/\\n/, "\n", output)
-		run = sprintf("cmp foo1 foo2 || echo test %d.%d failed",
-			nt, ++nt2)
+		run = sprintf("cmp foo1."nt"."nt2 " foo2."nt"."nt2 " || echo test %d.%d failed",
+			nt, nt2)
 		# print  "input is", input
 		# print  "test is", test
 		# print  "output is", output
 		# print  "run is", run
 		system(test output run)
+		nt2++
 	}
 	tt += nt2
 }
--