Fix old python2 test issue.

The map function returns a list in python2, but not in python3.
Force the test in cpp.py get_blocks() function to return a list.

Test: All cpp.py unit tests pass.
Change-Id: I1a63b92ac6cdb785830846fbd7e726eca7520e96
This commit is contained in:
Christopher Ferris 2022-08-05 12:59:05 -07:00
parent 462c542855
commit e0cb4e1094
1 changed files with 1 additions and 1 deletions

View File

@ -1647,7 +1647,7 @@ class BlockParserTests(unittest.TestCase):
def get_blocks(self, lines):
blocks = BlockParser().parse(CppStringTokenizer('\n'.join(lines)))
return map(lambda a: str(a), blocks)
return list(map(lambda a: str(a), blocks))
def test_hash(self):
self.assertEqual(self.get_blocks(["#error hello"]), ["#error hello"])