Created
December 10, 2014 22:00
-
-
Save seaneagan/3697f6c6371ac57d1cf8 to your computer and use it in GitHub Desktop.
yaml_map_value_node_end_offset_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:yaml/yaml.dart'; | |
main() { | |
var node = loadYamlNode(yaml); | |
var actualFooEnd = node.nodes['c'].nodes['x'].span.end.offset; | |
var expectedFooEnd = yaml.indexOf('foo') + 'foo'.length; | |
print('actual foo end: $actualFooEnd'); | |
print('expected foo end: $expectedFooEnd'); | |
assert(actualFooEnd == expectedFooEnd); | |
} | |
var yaml = ''' | |
a: 1 | |
b: 2 | |
c: | |
x: foo | |
y: bar | |
z: baz | |
d: 3 | |
'''; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It reports the end index of the "foo" node to be the start index of the "y" node, which is incorrect.