use super::shared::compile_eval;
#[test]
fn test_compile_eval() {
assert_eq!(compile_eval("true".into()), true);
assert_eq!(compile_eval("false".into()), false);
assert_eq!(compile_eval("".into()), false);
assert_eq!(compile_eval("not(true)".into()), false);
assert_eq!(compile_eval("not()".into()), true);
assert_eq!(compile_eval("equal(true, true)".into()), true);
assert_eq!(compile_eval("equal(false, false)".into()), true);
assert_eq!(compile_eval("equal(true, false)".into()), false);
assert_eq!(compile_eval("not(equal(true, true))".into()), false);
assert_eq!(compile_eval("not(equal(false, false))".into()), false);
assert_eq!(compile_eval("not(equal(true, false))".into()), true);
assert_eq!(compile_eval("xor(true, false)".into()), true);
assert_eq!(compile_eval("xor(false, true)".into()), true);
assert_eq!(compile_eval("xor(true, true)".into()), false);
assert_eq!(compile_eval("eq(2, 2)".into()), true);
assert_eq!(compile_eval("all(eq(2, 1), eq(1, 2))".into()), false);
assert_eq!(compile_eval("all(ne(2, 1), ne(1, 2))".into()), true);
assert_eq!(compile_eval("ne(2, 2)".into()), false);
assert_eq!(compile_eval("all(ge(2, 1), ge(2, 2))".into()), true);
assert_eq!(compile_eval("ge(1, 2)".into()), false);
assert_eq!(compile_eval("gt(2, 1)".into()), true);
assert_eq!(compile_eval("any(gt(1, 2), gt(2, 2))".into()), false);
assert_eq!(compile_eval("all(le(1, 2), le(2, 2))".into()), true);
assert_eq!(compile_eval("le(2, 1)".into()), false);
assert_eq!(compile_eval("lt(1, 2)".into()), true);
assert_eq!(compile_eval("any(lt(2, 1), lt(2, 2))".into()), false);
assert_eq!(compile_eval("any(true, true, true)".to_string()), true);
assert_eq!(compile_eval("any(false, true, true)".to_string()), true);
assert_eq!(compile_eval("any(false, false, false)".to_string()), false);
assert_eq!(compile_eval("all(true, true, true, true)".to_string()), true);
assert_eq!(compile_eval("all(true, true, true, false)".to_string()), false);
assert_eq!(compile_eval("none()".to_string()), true);
assert_eq!(compile_eval("none(true)".to_string()), false);
assert_eq!(compile_eval("none(false)".to_string()), false);
assert_eq!(compile_eval("none(something)".to_string()), false);
assert_eq!(compile_eval("some(true)".to_string()), true);
assert_eq!(compile_eval("some(false)".to_string()), true);
assert_eq!(compile_eval("some(something)".to_string()), true);
assert_eq!(compile_eval("some()".to_string()), false);
assert_eq!(compile_eval("same(ABC, ABC, ABC)".to_string()), true);
assert_eq!(compile_eval("same(ABC, DEF, ABC)".to_string()), false);
assert_eq!(compile_eval("diff(ABC, DEF, ABC)".to_string()), true);
assert_eq!(compile_eval("diff(ABC, ABC, ABC)".to_string()), false);
assert_eq!(compile_eval("nota(ABC, DEF, GHI)".to_string()), true);
assert_eq!(compile_eval("nota(ABC, DEF, ABC)".to_string()), false);
assert_eq!(compile_eval("xany(true, true, false)".into()), true);
assert_eq!(compile_eval("xany(true, true, true)".into()), false);
assert_eq!(compile_eval("xodd(true)".into()), true);
assert_eq!(compile_eval("xodd(true, false, false)".into()), true);
assert_eq!(compile_eval("xodd(true, true, false)".into()), false);
assert_eq!(compile_eval("xodd(true, true, true)".into()), true);
assert_eq!(compile_eval("xodd(true, true, true, true)".into()), false);
assert_eq!(compile_eval("xone(true, false, false, false)".into()), true);
assert_eq!(compile_eval("xone(true, true, false, false)".into()), false);
assert_eq!(compile_eval("xone(true, true, true, false)".into()), false);
assert_eq!(compile_eval("xone(true, true, true, true)".into()), false);
assert_eq!(compile_eval("env(CARGO_PKG_NAME)".into()), true);
assert_eq!(compile_eval("env_eq(CARGO_PKG_NAME, devela_macros)".into()), true);
assert_eq!(compile_eval("env_ne(CARGO_PKG_NAME, other_crate_name)".into()), true);
assert_eq!(compile_eval("env_nonempty(CARGO_PKG_NAME)".into()), true);
}