File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,8 @@ impl ParseState {
117
117
118
118
self . current_table_position += 1 ;
119
119
self . current_table . decor = decor;
120
+ self . current_table . set_implicit ( false ) ;
121
+ self . current_table . set_dotted ( false ) ;
120
122
self . current_table . set_position ( self . current_table_position ) ;
121
123
self . current_table . span = Some ( span) ;
122
124
self . current_is_array = true ;
@@ -152,6 +154,8 @@ impl ParseState {
152
154
153
155
self . current_table_position += 1 ;
154
156
self . current_table . decor = decor;
157
+ self . current_table . set_implicit ( false ) ;
158
+ self . current_table . set_dotted ( false ) ;
155
159
self . current_table . set_position ( self . current_table_position ) ;
156
160
self . current_table . span = Some ( span) ;
157
161
self . current_is_array = false ;
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ expected `]`
45
45
46
46
#[ test]
47
47
fn duplicate_table_after_dotted_key_issue_509 ( ) {
48
- "
48
+ let err = "
49
49
[dependencies.foo]
50
50
version = \" 0.16\"
51
51
@@ -56,7 +56,17 @@ libc = \"0.2\"
56
56
rand = \" 0.3.14\"
57
57
"
58
58
. parse :: < toml_edit:: Document > ( )
59
- . unwrap ( ) ;
59
+ . unwrap_err ( ) ;
60
+ snapbox:: assert_eq (
61
+ r#"TOML parse error at line 8, column 1
62
+ |
63
+ 8 | [dependencies]
64
+ | ^
65
+ invalid table header
66
+ duplicate key `dependencies` in document root
67
+ "# ,
68
+ err. to_string ( ) ,
69
+ ) ;
60
70
}
61
71
62
72
#[ test]
You can’t perform that action at this time.
0 commit comments