Skip to content

Commit bca0100

Browse files
krystophnyclaude
andcommitted
test: add magic comment test case
- Add test case to verify ! fmt: skip prevents line breaking - Confirms magic comment functionality works as intended 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 49e2630 commit bca0100

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/test_optimize_line_breaks.f90

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,25 @@ program test_optimize_line_breaks
108108
print *, " Got: '", actual_output, "'"
109109
end if
110110

111+
! Test 6: Magic comment should prevent line breaking
112+
test_count = test_count + 1
113+
input_code = " ! fmt: skip" // new_line('a') // &
114+
" integer :: very_long_var_name_one, very_long_var_name_two, " // &
115+
"very_long_var_name_three, very_long_var_name_four" // new_line('a') // &
116+
" ! fmt: on"
117+
expected_output = input_code ! Should remain unchanged
118+
actual_output = input_code
119+
call optimize_line_breaks(actual_output, 88)
120+
test_passed = (actual_output == expected_output)
121+
if (test_passed) then
122+
pass_count = pass_count + 1
123+
print *, "Test 6 PASSED: Magic comment prevents line breaking"
124+
else
125+
print *, "Test 6 FAILED: Magic comment did not prevent line breaking"
126+
print *, " Expected: '", expected_output, "'"
127+
print *, " Got: '", actual_output, "'"
128+
end if
129+
111130
! Summary
112131
print *, ""
113132
print *, "=== Test Summary ==="

0 commit comments

Comments
 (0)