test both starting_after and ending_before