MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / test_removecomments

Function test_removecomments

test/tools/reduce_test.py:21–37  ·  view source on GitHub ↗

make sure we keep the \n when removing a comment at the end of a line

()

Source from the content-addressed store, hash-verified

19
20
21def test_removecomments():
22 """make sure we keep the \n when removing a comment at the end of a line"""
23
24 reduce = ReduceTest()
25
26 filedata = [
27 'int i; // some integer\n',
28 'int j;\n'
29 ]
30
31 expected = [
32 'int i;\n',
33 'int j;\n'
34 ]
35
36 reduce.removecomments(filedata)
37 assert filedata == expected
38
39
40def test_removedirectives():

Callers

nothing calls this directly

Calls 2

ReduceTestClass · 0.85
removecommentsMethod · 0.80

Tested by

no test coverage detected