Skip to content

Commit 46dbd6f

Browse files
committed
Fix Google style format expectations in test_error_scenarios
Google style formats simple functions on a single line: int main() { return 0; } Updated test code to match Google style expectations: - test_multiple_files_all_pass - test_clean_code_returns_zero These tests were expecting multi-line format to pass, but Google style wants single-line format for simple functions.
1 parent bd3dffb commit 46dbd6f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/test_error_scenarios.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,10 @@ def test_multiple_files_all_pass(self):
217217
file1 = os.path.join(tmpdir, "file1.c")
218218
file2 = os.path.join(tmpdir, "file2.c")
219219

220-
# Both files properly formatted
220+
# Both files properly formatted for Google style
221221
for f in [file1, file2]:
222222
with open(f, "w") as fd:
223-
fd.write("int main() {\n return 0;\n}\n")
223+
fd.write("int main() { return 0; }\n")
224224

225225
result = sp.run(
226226
["clang-format-hook", "--style=google", file1, file2],
@@ -364,7 +364,7 @@ class TestReturnCodeCorrectness:
364364
def test_clean_code_returns_zero(self):
365365
"""Test that properly formatted, error-free code returns 0."""
366366
with tempfile.NamedTemporaryFile(mode="w", suffix=".c", delete=False) as f:
367-
f.write("int main() {\n return 0;\n}\n")
367+
f.write("int main() { return 0; }\n")
368368
temp_file = f.name
369369

370370
try:

0 commit comments

Comments
 (0)