From e1c3e8bc0d88851474ce4dbc83b0a75bd1a83c87 Mon Sep 17 00:00:00 2001 From: Jeff Date: Thu, 15 Feb 2024 07:12:10 -0500 Subject: [PATCH] Fix test --- src/abstract_tree/map_node.rs | 6 ++++++ tests/value.rs | 7 ------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/abstract_tree/map_node.rs b/src/abstract_tree/map_node.rs index d32b5f3..71fd221 100644 --- a/src/abstract_tree/map_node.rs +++ b/src/abstract_tree/map_node.rs @@ -80,6 +80,12 @@ impl AbstractTree for MapNode { fn run(&self, _source: &str, _context: &Context) -> Result { 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)) } } diff --git a/tests/value.rs b/tests/value.rs index 8ec6ef0..5789a9b 100644 --- a/tests/value.rs +++ b/tests/value.rs @@ -144,13 +144,6 @@ fn function() { assert_eq!(&Type::Boolean, function.return_type()); } -#[test] -fn option() { - let result = interpret("x = 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)));