diff --git a/tests/native.rs b/tests/native.rs index ac5c75b1..eed7b956 100644 --- a/tests/native.rs +++ b/tests/native.rs @@ -77,11 +77,19 @@ fn test_native_overload() -> Result<(), Box> { assert_eq!( engine.eval::(r#"let x = "hello"; let y = "world"; x + y"#)?, - "hello***world" + if cfg!(not(feature = "fast_ops")) { + "hello***world" + } else { + "helloworld" + } ); assert_eq!( engine.eval::(r#"let x = "hello"; let y = (); x + y"#)?, - "hello Foo!" + if cfg!(not(feature = "fast_ops")) { + "hello Foo!" + } else { + "hello" + } ); Ok(()) diff --git a/tests/plugins.rs b/tests/plugins.rs index 9186f59c..a7912a0a 100644 --- a/tests/plugins.rs +++ b/tests/plugins.rs @@ -80,6 +80,7 @@ macro_rules! expand_enum { #[export_module] pub mod $module { $( + #[allow(non_upper_case_globals)] pub const $variant: $typ = <$typ>::$variant; )* } @@ -127,7 +128,14 @@ fn test_plugins_package() -> Result<(), Box> { assert_eq!(engine.eval::("let a = [1, 2, 3]; test(a, 2)")?, 6); assert_eq!(engine.eval::("let a = [1, 2, 3]; hi(a, 2)")?, 6); assert_eq!(engine.eval::("let a = [1, 2, 3]; test(a, 2)")?, 6); - assert_eq!(engine.eval::("2 + 2")?, 5); + assert_eq!( + engine.eval::("2 + 2")?, + if cfg!(not(feature = "fast_ops")) { + 5 + } else { + 4 + } + ); assert_eq!( engine.eval::("let a = [1, 2, 3]; greet(test(a, 2))")?, "6 kitties"