tried to write a function to factor out boilerplate tests