test: sort pairs consistently