From 1c3e1880c0a6e5a30bdff9a7325bbd4964f9ae68 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 2 Oct 2021 19:46:59 +0200 Subject: [PATCH] Move test that requires "json5" feature to json5 tests Signed-off-by: Matthias Beyer --- tests/errors.rs | 16 ---------------- tests/file_json5.rs | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/tests/errors.rs b/tests/errors.rs index 856da4fa..7075dad3 100644 --- a/tests/errors.rs +++ b/tests/errors.rs @@ -134,19 +134,3 @@ fn error_with_path() { } } -#[test] -fn test_error_root_not_table() { - match Config::builder() - .add_source(File::from_str(r#"false"#, FileFormat::Json5)) - .build() - { - Ok(_) => panic!("Should not merge if root is not a table"), - Err(e) => match e { - ConfigError::FileParse { cause, .. } => assert_eq!( - "invalid type: boolean `false`, expected a map", - format!("{}", cause) - ), - _ => panic!("Wrong error: {:?}", e), - }, - } -} diff --git a/tests/file_json5.rs b/tests/file_json5.rs index a768bba0..4af3556e 100644 --- a/tests/file_json5.rs +++ b/tests/file_json5.rs @@ -94,3 +94,20 @@ fn test_error_parse() { ) ); } + +#[test] +fn test_error_root_not_table() { + match Config::builder() + .add_source(File::from_str(r#"false"#, FileFormat::Json5)) + .build() + { + Ok(_) => panic!("Should not merge if root is not a table"), + Err(e) => match e { + ConfigError::FileParse { cause, .. } => assert_eq!( + "invalid type: boolean `false`, expected a map", + format!("{}", cause) + ), + _ => panic!("Wrong error: {:?}", e), + }, + } +}