Add fast-ops feature.

This commit is contained in:
Stephen Chung
2022-09-02 23:45:25 +08:00
parent 7dbc605d0b
commit 0516e8088c
7 changed files with 71 additions and 13 deletions

View File

@@ -169,6 +169,22 @@ fn test_arrays() -> Result<(), Box<EvalAltResult>> {
"
)?);
let value = vec![
String::from("hello"),
String::from("world"),
String::from("foo"),
String::from("bar"),
];
let array: Dynamic = value.into();
assert_eq!(array.type_name(), "array");
let array = array.cast::<Array>();
assert_eq!(array[0].type_name(), "string");
assert_eq!(array.len(), 4);
Ok(())
}