Fixup code to make sure all feature builds succeed.

This commit is contained in:
Stephen Chung
2020-03-14 20:06:40 +08:00
parent 973153e832
commit dd36f3387a
7 changed files with 30 additions and 12 deletions

View File

@@ -12,6 +12,7 @@ fn test_constant() -> Result<(), EvalAltResult> {
Ok(_) => panic!("expecting compilation error"),
}
#[cfg(not(feature = "no_index"))]
match engine.eval::<i64>("const x = [1, 2, 3, 4, 5]; x[2] = 42;") {
Err(EvalAltResult::ErrorAssignmentToConstant(var, _)) if var == "x" => (),
Err(err) => return Err(err),

View File

@@ -1,4 +1,7 @@
use rhai::{Engine, EvalAltResult, FLOAT, INT};
use rhai::{Engine, EvalAltResult, INT};
#[cfg(not(feature = "no_float"))]
use rhai::FLOAT;
#[test]
fn test_power_of() -> Result<(), EvalAltResult> {