Implement test

Adds Posix-conformant, non-XSI-conformant test util.

See http://pubs.opengroup.org/onlinepubs/9699919799/
I don't think this would improve the code.