Fix test
This commit is contained in:
parent
a6e52e4ee6
commit
e1c3e8bc0d
@ -80,6 +80,12 @@ impl AbstractTree for MapNode {
|
||||
fn run(&self, _source: &str, _context: &Context) -> Result<Value, RuntimeError> {
|
||||
let mut map = Map::new();
|
||||
|
||||
for (key, (statement, _)) in &self.properties {
|
||||
let value = statement.run(_source, _context)?;
|
||||
|
||||
map.set(key.clone(), value);
|
||||
}
|
||||
|
||||
Ok(Value::Map(map))
|
||||
}
|
||||
}
|
||||
|
@ -144,13 +144,6 @@ fn function() {
|
||||
assert_eq!(&Type::Boolean, function.return_type());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn option() {
|
||||
let result = interpret("x <option(int)> = some(1); x").unwrap();
|
||||
|
||||
assert_eq!(Value::Option(Some(Box::new(Value::Integer(1)))), result);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn range() {
|
||||
assert_eq!(interpret("0..100"), Ok(Value::range(0, 100)));
|
||||
|
Loading…
Reference in New Issue
Block a user