refactor tests to use a fixture to set up the sample tests and parse the output of test runs more robustly

this should hopefully make the tests easier to read, too...