Add tests for compound queries