From b05b927c7af12be7b2115a642a7d54f5d0f6b08f Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 1 May 2023 19:06:41 +0100 Subject: Test slurping of empty input text --- tests/jq_tests.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/jq_tests.py b/tests/jq_tests.py index 5f6bb16..bf40679 100644 --- a/tests/jq_tests.py +++ b/tests/jq_tests.py @@ -97,6 +97,14 @@ def test_input_can_be_text_with_multiple_values_separated_by_newlines(): assert_equal([1, 2, 3], result) +def test_slurping_empty_input_text_reads_input_as_empty_array(): + program = jq.compile(".") + + result = program.input_text("1\n2\n3\n", slurp=True).all() + + assert_equal([[1, 2, 3]], result) + + def test_slurping_input_text_reads_input_as_single_array(): program = jq.compile(".") -- cgit v1.2.3