Add test to verify sort and limit together

@pbadenski
@robyoung