Sort results in tests before comparing

/cc @hampelm