refactor tests. implement output matcher for checking stderr warnings