http://qualdan.com/forth/flex-tester-2012-05-30.tar.gz
I wrote this back in November, and then promptly forgot about it until a
couple of days ago when I needed to test some string manipulation words.
It seems to be complete. I banged on it for an hour or so and it
doesn't seem to be brittle the way my last try (2008 sometime?) was. So
I added a quick README and am posting it as-is on the off chance that
others might find it interesting.
Instead of listing the types separately, it uses inline specifiers. So
X: says that the next thing on the stack is an unsigned hexadecimal
value. S: treats the next two cells as a c-addr u string and compares
the contents, and it's OK if the addresses are different, and so on. So
for example:
ok> T{ here => X: here 1+ }T
Test Failed: T{ here => X: here 1+ }T
Expected: ( $B7A322D5 )
Received: ( $B7A322D4 )
ok> T{ s" foo" => S: s" bar" }T
Test Failed: T{ s" foo" => S: s" bar" }T
Expected: ( $9B69508 3 ("bar") )
Received: ( $9B69758 3 ("foo") )
ok>
The implementation was clearly inspired by David N. Williams's
ttester-xf, where you load a separate file for each stack you want to
test, but uses an array of execution tables instead of redefining T{ and
friends (I'm not sure that's an advantage, but there it is).
Cheers,
--Josh