File tree 1 file changed +9
-4
lines changed 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -142,8 +142,11 @@ mod test {
142
142
fn test_config_bad_toml ( ) {
143
143
let error =
144
144
read_config ( "bad_toml" , "foo =" ) . expect_err ( "expected failure" ) ;
145
+
145
146
if let LoadError :: Parse ( error) = error {
146
147
assert_eq ! ( error. line_col( ) , Some ( ( 0 , 5 ) ) ) ;
148
+ } else {
149
+ panic ! ( "Got an unexpected error, expected Parse but got {:?}" , error) ;
147
150
}
148
151
}
149
152
@@ -155,10 +158,12 @@ mod test {
155
158
#[ test]
156
159
fn test_config_empty ( ) {
157
160
let error = read_config ( "empty" , "" ) . expect_err ( "expected failure" ) ;
158
- /*
159
- assert!(error.starts_with("parse \""));
160
- assert!(error.contains("\": missing field"));
161
- */
161
+
162
+ if let LoadError :: Parse ( error) = error {
163
+ assert_eq ! ( error. line_col( ) , None ) ;
164
+ } else {
165
+ panic ! ( "Got an unexpected error, expected Parse but got {:?}" , error) ;
166
+ }
162
167
}
163
168
164
169
/*
You can’t perform that action at this time.
0 commit comments