Fix tests.

This commit is contained in:
Stephen Chung 2020-04-23 14:00:29 +08:00
parent 5aaaa7be3b
commit a306979a9c
3 changed files with 5 additions and 3 deletions

View File

@ -1471,8 +1471,8 @@ The following methods (defined in the [`BasicMapPackage`](#packages) but exclude
| `remove` | property name | removes a certain property and returns it ([`()`] if the property does not exist) |
| `mixin` | second object map | mixes in all the properties of the second object map to the first (values of properties with the same names replace the existing values) |
| `+` operator | first object map, second object map | merges the first object map with the second |
| `keys` | _none_ | returns an [array] of all the property names (in random order) |
| `values` | _none_ | returns an [array] of all the property values (in random order) |
| `keys` | _none_ | returns an [array] of all the property names (in random order), not available under [`no_index`] |
| `values` | _none_ | returns an [array] of all the property values (in random order), not available under [`no_index`] |
### Examples

View File

@ -13,6 +13,7 @@ fn test_arrays() -> Result<(), Box<EvalAltResult>> {
);
assert!(engine.eval::<bool>("let y = [1, 2, 3]; 2 in y")?);
#[cfg(not(feature = "no_object"))]
assert_eq!(
engine.eval::<INT>(
r"
@ -35,7 +36,7 @@ fn test_arrays() -> Result<(), Box<EvalAltResult>> {
r"
let x = [1, 2, 3];
x += [4, 5];
x.len()
len(x)
"
)?,
5

View File

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