diff --git a/src/bin/evalexpr.rs b/src/bin/evalexpr.rs index ac1ee3f3..f1668d70 100644 --- a/src/bin/evalexpr.rs +++ b/src/bin/evalexpr.rs @@ -1,3 +1,4 @@ +#![cfg(not(tarpaulin_include))] pub fn main() -> Result<(), Box> { let args = std::env::args().skip(1).collect::>().join(" "); diff --git a/src/feature_serde/mod.rs b/src/feature_serde/mod.rs index 88a5a7c2..112cbf08 100644 --- a/src/feature_serde/mod.rs +++ b/src/feature_serde/mod.rs @@ -33,3 +33,32 @@ impl de::Visitor<'_> for NodeVisitor) -> std::fmt::Result { + NodeVisitor::(PhantomData).expecting(f) + } + } + + let mut output = String::new(); + write!(output, "{:?}", Debugger).unwrap(); + assert!(!output.is_empty()); + } +} diff --git a/tests/integration.rs b/tests/integration.rs index 977f293b..9cea35cb 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -2500,3 +2500,47 @@ fn test_clear() { assert!(context.get_value("five").is_none()); assert!(eval_with_context("abc(5)", &context).is_err()); } + +#[test] +fn test_iter_empty_contexts() { + assert_eq!( + EmptyContext::::default() + .iter_variables() + .next(), + None + ); + assert_eq!( + EmptyContext::::default() + .iter_variable_names() + .next(), + None + ); + assert_eq!( + EmptyContextWithBuiltinFunctions::::default() + .iter_variables() + .next(), + None + ); + assert_eq!( + EmptyContextWithBuiltinFunctions::::default() + .iter_variable_names() + .next(), + None + ); +} + +#[test] +fn test_empty_context_builtin_functions() { + assert!(EmptyContext::::default().are_builtin_functions_disabled()); + assert!( + !EmptyContextWithBuiltinFunctions::::default() + .are_builtin_functions_disabled() + ); +} + +#[test] +fn test_compare_different_numeric_types() { + assert_eq!(eval("1 < 2.0"), Ok(true.into())); + assert_eq!(eval("1 >= 2"), Ok(false.into())); + assert_eq!(eval("1 >= 2.0"), Ok(false.into())); +}