Fix features.

This commit is contained in:
Stephen Chung
2020-07-01 22:21:43 +08:00
parent 7957c58def
commit 760c13d36e
9 changed files with 36 additions and 6 deletions

View File

@@ -35,6 +35,7 @@ fn test_max_string_size() -> Result<(), Box<EvalAltResult>> {
EvalAltResult::ErrorDataTooLarge(_, 10, 13, _)
));
#[cfg(not(feature = "no_object"))]
assert!(matches!(
*engine
.eval::<String>(
@@ -92,6 +93,8 @@ fn test_max_array_size() -> Result<(), Box<EvalAltResult>> {
.expect_err("should error"),
EvalAltResult::ErrorDataTooLarge(_, 10, 12, _)
));
#[cfg(not(feature = "no_object"))]
assert!(matches!(
*engine
.eval::<Array>(

View File

@@ -39,7 +39,7 @@ fn test_for_string() -> Result<(), Box<EvalAltResult>> {
let sum = 0;
for ch in s {
sum += ch.to_int();
sum += to_int(ch);
}
sum

View File

@@ -52,6 +52,7 @@ fn test_functions() -> Result<(), Box<EvalAltResult>> {
}
#[test]
#[cfg(not(feature = "no_object"))]
fn test_function_pointers() -> Result<(), Box<EvalAltResult>> {
let engine = Engine::new();