diff --git a/gene/src/paths.rs b/gene/src/paths.rs index 81d2f7e..8b1d109 100644 --- a/gene/src/paths.rs +++ b/gene/src/paths.rs @@ -5,7 +5,7 @@ use thiserror::Error; use crate::rules::matcher::{MatchParser, Rule}; -#[derive(Error, Debug, Clone)] +#[derive(Error, Debug, Clone, PartialEq)] pub enum PathError { #[error("{0}")] Parse(#[from] Box>), diff --git a/gene/src/rules.rs b/gene/src/rules.rs index a0bbe09..bcc0ae4 100644 --- a/gene/src/rules.rs +++ b/gene/src/rules.rs @@ -228,7 +228,7 @@ pub struct CompiledRule { pub(crate) actions: HashSet, } -#[derive(Debug, Error)] +#[derive(Debug, Error, PartialEq)] pub enum Error { #[error("rule={0} {1}")] Wrap(String, Box), diff --git a/gene/src/rules/condition.rs b/gene/src/rules/condition.rs index e92d3b6..94ec1cc 100644 --- a/gene/src/rules/condition.rs +++ b/gene/src/rules/condition.rs @@ -23,13 +23,13 @@ lazy_static::lazy_static! { }; } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub(crate) enum Op { And, Or, } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub(crate) enum Expr { Variable(String), BinOp { @@ -47,7 +47,7 @@ impl Default for Expr { } } -#[derive(Error, Debug)] +#[derive(Error, Debug, PartialEq)] pub enum Error { #[error("unknown operand {0}")] UnknowOperand(String), diff --git a/gene/src/rules/matcher.rs b/gene/src/rules/matcher.rs index a6e2d7e..5f69a3c 100644 --- a/gene/src/rules/matcher.rs +++ b/gene/src/rules/matcher.rs @@ -82,7 +82,7 @@ impl MatchValue { } } -#[derive(Error, Debug)] +#[derive(Error, Debug, PartialEq)] pub enum Error { #[error("field={0} not found")] FieldNotFound(String), diff --git a/gene/src/values.rs b/gene/src/values.rs index 6d075a7..9f4b421 100644 --- a/gene/src/values.rs +++ b/gene/src/values.rs @@ -7,7 +7,7 @@ use std::{ use thiserror::Error; -#[derive(Debug, Error)] +#[derive(Debug, Error, PartialEq)] pub enum NumberError { #[error("")] InvalidConvertion,