From 86cebe2a57dc213fb4e5bf4db4f51d01ca40182e Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 1 May 2023 17:14:32 +0100 Subject: Add input_value() and input_text() --- tests/jq_tests.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/jq_tests.py') diff --git a/tests/jq_tests.py b/tests/jq_tests.py index ebb7a6c..d97b1c2 100644 --- a/tests/jq_tests.py +++ b/tests/jq_tests.py @@ -65,6 +65,22 @@ def test_when_text_argument_is_used_then_input_is_treated_as_json_text(): ) +def test_input_can_be_value(): + program = jq.compile(".") + + result = program.input_value("42").first() + + assert_equal("42", result) + + +def test_input_can_be_text(): + program = jq.compile(".") + + result = program.input_text("42").first() + + assert_equal(42, result) + + def test_when_text_method_is_used_on_result_then_output_is_serialised_to_json_string(): assert_equal( '"42"', -- cgit v1.2.3