Skip to content

Commit d6bd62b

Browse files
committed
fix up two more tests
1 parent 4a66303 commit d6bd62b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/oxide_controller/config.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,11 @@ mod test {
142142
fn test_config_bad_toml() {
143143
let error =
144144
read_config("bad_toml", "foo =").expect_err("expected failure");
145+
145146
if let LoadError::Parse(error) = error {
146147
assert_eq!(error.line_col(), Some((0, 5)));
148+
} else {
149+
panic!("Got an unexpected error, expected Parse but got {:?}", error);
147150
}
148151
}
149152

@@ -155,10 +158,12 @@ mod test {
155158
#[test]
156159
fn test_config_empty() {
157160
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+
}
162167
}
163168

164169
/*

0 commit comments

Comments
 (0)