aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/data/parser/0002_struct_item_field.rs3
-rw-r--r--tests/data/parser/0002_struct_item_field.txt15
-rw-r--r--tests/parser.rs3
3 files changed, 20 insertions, 1 deletions
diff --git a/tests/data/parser/0002_struct_item_field.rs b/tests/data/parser/0002_struct_item_field.rs
new file mode 100644
index 000000000..cc3866d25
--- /dev/null
+++ b/tests/data/parser/0002_struct_item_field.rs
@@ -0,0 +1,3 @@
1struct S {
2 foo: u32
3} \ No newline at end of file
diff --git a/tests/data/parser/0002_struct_item_field.txt b/tests/data/parser/0002_struct_item_field.txt
new file mode 100644
index 000000000..b1673ade3
--- /dev/null
+++ b/tests/data/parser/0002_struct_item_field.txt
@@ -0,0 +1,15 @@
1FILE@[0; 25)
2 STRUCT_ITEM@[0; 25)
3 STRUCT_KW@[0; 6)
4 WHITESPACE@[6; 7)
5 IDENT@[7; 8)
6 WHITESPACE@[8; 9)
7 L_CURLY@[9; 10)
8 STRUCT_FIELD@[10; 24)
9 WHITESPACE@[10; 15)
10 IDENT@[15; 18)
11 COLON@[18; 19)
12 WHITESPACE@[19; 20)
13 IDENT@[20; 23)
14 WHITESPACE@[23; 24)
15 R_CURLY@[24; 25) \ No newline at end of file
diff --git a/tests/parser.rs b/tests/parser.rs
index e71b48852..5c63be3be 100644
--- a/tests/parser.rs
+++ b/tests/parser.rs
@@ -61,7 +61,8 @@ fn dump_tree(file: &File) -> String {
61 61
62 fn go(node: Node, buff: &mut String, level: usize) { 62 fn go(node: Node, buff: &mut String, level: usize) {
63 buff.push_str(&String::from(" ").repeat(level)); 63 buff.push_str(&String::from(" ").repeat(level));
64 write!(buff, "{:?}\n", node); 64 write!(buff, "{:?}\n", node)
65 .unwrap();
65 for child in node.children() { 66 for child in node.children() {
66 go(child, buff, level + 1) 67 go(child, buff, level + 1)
67 } 68 }