helper for testing queries