Generalized test, so that it can be run with parsed queries