pkg/yaml: YamlMap iteration order doesn't preserve yaml document order #7
Labels
closed-not-planned
Closed as we don't intend to take action on the reported issue
type-enhancement
A request for a change that isn't a bug
<img src="https://avatars.githubusercontent.com/u/444270?v=3" align="left" width="96" height="96"hspace="10"> Issue by seaneagan
Originally opened as dart-lang/sdk#21328
Here's the failing test:
import 'package:unittest/unittest.dart';
import 'package:yaml/yaml.dart';
main() {
Map map = loadYaml(yaml);
expect(map.keys.toList(), ['foo', 'bar', 'baz']);
}
var yaml = '''
foo: x
bar: y
baz: z
''';
Guessing it would just need to switch to an underlying LinkedHashMap so long as the keys are inserted in document order. I expected this to work given that it does with JSON.
The text was updated successfully, but these errors were encountered: