improve tests by making sure the values are sorted by length and not by string comparison