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

Function test_combinelines_chunk_2

test/tools/reduce_test.py:108–143  ·  view source on GitHub ↗

filedata' is not changed by the function since the data is assigned to a local variable

()

Source from the content-addressed store, hash-verified

106
107
108def test_combinelines_chunk_2():
109 """'filedata' is not changed by the function since the data is assigned to a local variable"""
110
111 reduce = ReduceTest()
112
113 # need to have at least 11 lines ending with comma to enter chunked mode
114 filedata = [
115 'int i,\n',
116 'j,\n',
117 'k,\n',
118 'l,\n',
119 'm,\n',
120 'n,\n',
121 'o,\n',
122 'p,\n',
123 'q,\n',
124 'r,\n',
125 's,\n',
126 't;\n'
127 ]
128 filedata_exp = filedata
129
130 filedata2 = reduce.combinelines(filedata)
131 assert filedata == filedata_exp
132 assert filedata2 == ['int i,j,\n',
133 '',
134 'l,\n',
135 'm,\n',
136 'n,\n',
137 'o,\n',
138 'p,\n',
139 'q,\n',
140 'r,\n',
141 's,\n',
142 't;\n',
143 '']

Callers

nothing calls this directly

Calls 2

ReduceTestClass · 0.85
combinelinesMethod · 0.80

Tested by

no test coverage detected