Make sure all tests run with all features.

This commit is contained in:
Stephen Chung
2020-03-10 19:48:47 +08:00
parent cc772c6e2a
commit e22aaca5c1
14 changed files with 71 additions and 38 deletions

View File

@@ -6,11 +6,15 @@ fn test_chars() -> Result<(), EvalAltResult> {
assert_eq!(engine.eval::<char>("'y'")?, 'y');
assert_eq!(engine.eval::<char>("'\\u2764'")?, '❤');
assert_eq!(engine.eval::<char>(r#"let x="hello"; x[2]"#)?, 'l');
assert_eq!(
engine.eval::<String>(r#"let x="hello"; x[2]='$'; x"#)?,
"he$lo".to_string()
);
#[cfg(not(feature = "no_index"))]
{
assert_eq!(engine.eval::<char>(r#"let x="hello"; x[2]"#)?, 'l');
assert_eq!(
engine.eval::<String>(r#"let x="hello"; x[2]='$'; x"#)?,
"he$lo".to_string()
);
}
assert!(engine.eval::<char>("'\\uhello'").is_err());
assert!(engine.eval::<char>("''").is_err());