Helper function for testing Node.pprint with indexes.
(values: NodeValueList)
| 39 | |
| 40 | |
| 41 | def pprint_with_index(values: NodeValueList) -> List[str]: |
| 42 | """Helper function for testing Node.pprint with indexes.""" |
| 43 | root = build(values) |
| 44 | assert root is not None |
| 45 | |
| 46 | with CaptureOutput() as output: |
| 47 | root.pprint(index=True, delimiter=":") |
| 48 | assert output[0] == "" and output[-1] == "" |
| 49 | return [line for line in output if line != ""] |
| 50 | |
| 51 | |
| 52 | def builtin_print(values: NodeValueList) -> List[str]: |