Test sorting primitives