Skip to content

Commit e312a12

Browse files
dmcppcheckclaude
andcommitted
fix expected debug output in test_include
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 40ae723 commit e312a12

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎test/cli/clang-import_test.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ def test_log(tmpdir):
129129

130130

131131
def test_include(tmp_path):
132-
# the declaration before the #include is needed so the header is seen in the AST dump after tokens have been created
133132
test_file = tmp_path / 'test.c'
134133
with open(test_file, 'wt') as f:
135134
f.write('#include "test.h"')
@@ -139,7 +138,9 @@ def test_include(tmp_path):
139138

140139
exitcode, stdout, stderr = cppcheck(['-q', '--clang', '--debug', str(test_file)])
141140
assert exitcode == 0, stderr if not stdout else stdout
142-
assert '##file {}\n\n1: int x@var2 ;\n'.format(tmp_path / 'test.h') in stdout, stdout
141+
# the number of empty lines after "##file" depends on the builtin declarations in the clang AST dump
142+
assert '##file {}\n'.format(tmp_path / 'test.h') in stdout, stdout
143+
assert '\n1: int x@var1 ;\n' in stdout, stdout
143144

144145

145146
def test_warning(tmpdir): # #12424

0 commit comments

Comments
 (0)