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

Function test_combinelines_chunk

test/tools/reduce_test.py:67–105  ·  view source on GitHub ↗

do not fail with 'TypeError: slice indices must be integers or None or have an __index__ method

()

Source from the content-addressed store, hash-verified

65
66
67def test_combinelines_chunk():
68 """do not fail with 'TypeError: slice indices must be integers or None or have an __index__ method'"""
69
70 class ReduceTestFail(ReduceTest):
71 def runtool(self, filedata=None):
72 print(filedata)
73 return False
74
75 reduce = ReduceTestFail()
76
77 # need to have at least 11 lines ending with comma to enter chunked mode and twice as much for second iteration
78 filedata = [
79 'int i,\n',
80 'j,\n',
81 'k,\n',
82 'l,\n',
83 'm,\n',
84 'n,\n',
85 'o,\n',
86 'p,\n',
87 'q,\n',
88 'r,\n',
89 's,\n',
90 't;\n',
91 'int i1,\n',
92 'j1,\n',
93 'k1,\n',
94 'l1,\n',
95 'm1,\n',
96 'n1,\n',
97 'o1,\n',
98 'p1,\n',
99 'q1,\n',
100 'r1,\n',
101 's1,\n',
102 't1;\n'
103 ]
104
105 reduce.combinelines(filedata)
106
107
108def test_combinelines_chunk_2():

Callers

nothing calls this directly

Calls 2

ReduceTestFailClass · 0.85
combinelinesMethod · 0.80

Tested by

no test coverage detected