From 29fafd1a6391231a074528efec107ecfcc42932e Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 7 Apr 2021 20:49:52 -0500 Subject: [PATCH] test(config): Verify layering --- src/config.rs | 84 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 77 insertions(+), 7 deletions(-) diff --git a/src/config.rs b/src/config.rs index dba0e2b..b1e98f1 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)] +#[derive(Debug, Clone, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)] #[serde(deny_unknown_fields, default)] #[serde(rename_all = "kebab-case")] pub struct Config { @@ -56,7 +56,7 @@ impl Config { } } -#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)] +#[derive(Debug, Clone, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)] #[serde(deny_unknown_fields, default)] #[serde(rename_all = "kebab-case")] pub struct Walk { @@ -137,7 +137,7 @@ impl Walk { } } -#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)] +#[derive(Debug, Clone, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)] #[serde(deny_unknown_fields, default)] #[serde(rename_all = "kebab-case")] pub struct TypeEngineConfig { @@ -153,7 +153,7 @@ impl TypeEngineConfig { } } -#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)] +#[derive(Debug, Clone, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)] #[serde(deny_unknown_fields, default)] #[serde(rename_all = "kebab-case")] pub struct EngineConfig { @@ -226,7 +226,7 @@ impl EngineConfig { } } -#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)] +#[derive(Debug, Clone, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)] #[serde(deny_unknown_fields, default)] #[serde(rename_all = "kebab-case")] pub struct TokenizerConfig { @@ -297,7 +297,7 @@ impl TokenizerConfig { } } -#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)] +#[derive(Debug, Clone, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)] #[serde(deny_unknown_fields, default)] #[serde(rename_all = "kebab-case")] pub struct DictConfig { @@ -366,7 +366,7 @@ fn find_project_file(dir: &std::path::Path, names: &[&str]) -> Option = vec!["*.foo".into(), "*.bar".into()]; + assert_eq!(actual.extend_glob, expected); + } +}