Factor out limit and offset tests