(parser)
| 403 | |
| 404 | |
| 405 | def test_multiline_histitem(parser) -> None: |
| 406 | from cmd2.history import ( |
| 407 | History, |
| 408 | ) |
| 409 | |
| 410 | line = "multiline foo\nbar\n\n" |
| 411 | statement = parser.parse(line) |
| 412 | history = History() |
| 413 | history.append(statement) |
| 414 | assert len(history) == 1 |
| 415 | hist_item = history[0] |
| 416 | assert hist_item.raw == line |
| 417 | pr_lines = hist_item.pr(1).splitlines() |
| 418 | assert pr_lines[0].endswith("multiline foo bar") |
| 419 | |
| 420 | |
| 421 | def test_multiline_with_quotes_histitem(parser) -> None: |