tests for the core query functions