From 14393f779c2c9e2e0c99863b193738ba29a6660a Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 11 Oct 2020 11:54:37 +0100 Subject: Add support for predefined variables --- tests/jq_tests.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/jq_tests.py b/tests/jq_tests.py index 6b63556..7956d56 100644 --- a/tests/jq_tests.py +++ b/tests/jq_tests.py @@ -184,6 +184,14 @@ def unicode_strings_can_be_used_as_programs(): ) +@istest +def compiling_with_args_should_set_predefined_variables(): + assert_equal( + 123, + jq.compile("$a + $b + .", args={"a": 100, "b": 20}).input(3).first() + ) + + @istest def repr_of_compile_result_is_compilation_string(): program = jq.compile(".") -- cgit v1.2.3