Previously, due to golang maps guaranteeing random key order, the test covering this code was flaky, as x or y might be first depending on the runtime conditions.
This changes it to allocate a list of keys, sort it, and then iterate over that instead of the map itself, guaranteeing not the input order, but at least a consistent one.
Previously, due to golang maps guaranteeing random key order, the test covering this code was flaky, as x or y might be first depending on the runtime conditions.
This changes it to allocate a list of keys, sort it, and then iterate over that instead of the map itself, guaranteeing not the input order, but at least a consistent one.
Fixes #87's flaky tests.