lib: Include fields in ts_node_string output

This allows you to assert about fields in tests. But if your test 
s-expression does *not* include fields, the fields will be stripped from 
the regexp before comparison.
This commit is contained in:
Max Brunsfeld 2019-02-13 09:47:21 -08:00
parent 9f608435ee
commit 65d1ce8593
6 changed files with 113 additions and 45 deletions

View file

@ -721,7 +721,7 @@ fn test_parsing_with_included_ranges_and_missing_tokens() {
let root = tree.root_node();
assert_eq!(
root.to_sexp(),
"(program (A (MISSING)) (b) (c) (A (MISSING)) (b) (c))"
"(program (A (MISSING a)) (b) (c) (A (MISSING a)) (b) (c))"
);
assert_eq!(root.start_byte(), 2);
assert_eq!(root.child(3).unwrap().start_byte(), 4);