Skip to content

Commit b3a750f

Browse files
committed
Add input variable tests, fix a bunch of related bugs
1 parent ba7839f commit b3a750f

File tree

12 files changed

+1046
-20
lines changed

12 files changed

+1046
-20
lines changed

src/ast.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,8 @@ impl InputValue {
289289
/// Resolve all variables to their values.
290290
pub fn into_const(self, vars: &HashMap<String, InputValue>) -> InputValue {
291291
match self {
292-
InputValue::Variable(v) => vars[&v].clone(),
292+
InputValue::Variable(v) => vars.get(&v)
293+
.map_or_else(InputValue::null, Clone::clone),
293294
InputValue::List(l) => InputValue::List(
294295
l.into_iter().map(|s| s.map(|v| v.into_const(vars))).collect()
295296
),

src/executor_tests/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
mod introspection;
2+
mod variables;

0 commit comments

Comments
 (0)