diff --git a/tests/test_formatting.py b/tests/test_formatting.py index f7cc290..b385abb 100755 --- a/tests/test_formatting.py +++ b/tests/test_formatting.py @@ -97,6 +97,16 @@ def test_format_comment_separator(self): self._format(code.encode()).decode().splitlines(), expected.splitlines() ) + def test_multiple_function_calls(self): + """Validates correct line break when a expression with function calls + need to be broken. This is a regression test for #69.""" + code = "f(x) " + "+ f(x)" * 20 + ";" + formatted = self._format(code.encode()).decode() + self.assertTrue( + formatted.splitlines()[0].endswith("("), + "expression should not break function calls across lines", + ) + class TestFormattingErrors(unittest.TestCase): def _format(self, content): diff --git a/tree-sitter-zeek b/tree-sitter-zeek index b1fdab4..92dff79 160000 --- a/tree-sitter-zeek +++ b/tree-sitter-zeek @@ -1 +1 @@ -Subproject commit b1fdab493110b542a9deabecf911d8a148649fc2 +Subproject commit 92dff79450f63e56dcb8cdabc8e673ac957caa37