aboutsummaryrefslogtreecommitdiffstats
path: root/test.awk
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-10-18 07:27:49 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-10-18 07:27:49 -0700
commitf6554ffa53bb3247d184afc3c89b077c19c5cc5c (patch)
tree051d759b01be8017b9aa16f1193c4639a20d40a4 /test.awk
parent0012d8688217585c366aaa0f7389f4c8a1ee0dea (diff)
downloadjp-hash-f6554ffa53bb3247d184afc3c89b077c19c5cc5c.tar.gz
jp-hash-f6554ffa53bb3247d184afc3c89b077c19c5cc5c.tar.bz2
jp-hash-f6554ffa53bb3247d184afc3c89b077c19c5cc5c.zip
New project: JP-Hash
Diffstat (limited to 'test.awk')
-rwxr-xr-xtest.awk17
1 files changed, 17 insertions, 0 deletions
diff --git a/test.awk b/test.awk
new file mode 100755
index 0000000..a717ff7
--- /dev/null
+++ b/test.awk
@@ -0,0 +1,17 @@
+#!/usr/bin/awk -f
+
+BEGIN {
+ if (ARGC != 3) {
+ printf("usage: test.awk <program> <test-vec-file>\n", ARGV[0]);
+ exit 1
+ }
+
+ program = ARGV[1]
+ file = ARGV[2]
+
+ while ((getline < file) > 0) {
+ input = ($1 == "EMPTY" ? "" : $1)
+ program " '" input "'" | getline jhash
+ print $1, "-->", jhash
+ }
+}