Skip to content

Commit 1c3e188

Browse files
committed
Move test that requires "json5" feature to json5 tests
Signed-off-by: Matthias Beyer <[email protected]>
1 parent bbbabf7 commit 1c3e188

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

tests/errors.rs

-16
Original file line numberDiff line numberDiff line change
@@ -134,19 +134,3 @@ fn error_with_path() {
134134
}
135135
}
136136

137-
#[test]
138-
fn test_error_root_not_table() {
139-
match Config::builder()
140-
.add_source(File::from_str(r#"false"#, FileFormat::Json5))
141-
.build()
142-
{
143-
Ok(_) => panic!("Should not merge if root is not a table"),
144-
Err(e) => match e {
145-
ConfigError::FileParse { cause, .. } => assert_eq!(
146-
"invalid type: boolean `false`, expected a map",
147-
format!("{}", cause)
148-
),
149-
_ => panic!("Wrong error: {:?}", e),
150-
},
151-
}
152-
}

tests/file_json5.rs

+17
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,20 @@ fn test_error_parse() {
9494
)
9595
);
9696
}
97+
98+
#[test]
99+
fn test_error_root_not_table() {
100+
match Config::builder()
101+
.add_source(File::from_str(r#"false"#, FileFormat::Json5))
102+
.build()
103+
{
104+
Ok(_) => panic!("Should not merge if root is not a table"),
105+
Err(e) => match e {
106+
ConfigError::FileParse { cause, .. } => assert_eq!(
107+
"invalid type: boolean `false`, expected a map",
108+
format!("{}", cause)
109+
),
110+
_ => panic!("Wrong error: {:?}", e),
111+
},
112+
}
113+
}

0 commit comments

Comments
 (0)