| 448 | } |
| 449 | |
| 450 | void TestBreakpointModel::testDocumentEditAndSave() |
| 451 | { |
| 452 | const auto [url, doc, b1, b2] = setupEditAndCheckPrimaryDocumentAndBreakpoints(); |
| 453 | RETURN_IF_TEST_FAILED(); |
| 454 | |
| 455 | // save() shall make the breakpoint tracked line numbers persistent. |
| 456 | // After saving, close() should have no effect on the line numbers |
| 457 | // other than detaching all moving cursors from the document. |
| 458 | QVERIFY(doc->save()); |
| 459 | QVERIFY(doc->close()); |
| 460 | QCOMPARE(doc->state(), IDocument::Clean); |
| 461 | |
| 462 | // Wait needed for BreakpointModel::save() to complete. |
| 463 | QTest::qWait(1); |
| 464 | |
| 465 | // verify. |
| 466 | VERIFY_UNTRACKED_BREAKPOINT(b1, 23, ); |
| 467 | VERIFY_UNTRACKED_BREAKPOINT(b2, 24, ); |
| 468 | const auto savedBreakpoints = readBreakpointsFromConfig(); |
| 469 | QCOMPARE(savedBreakpoints.size(), 2); |
| 470 | QCOMPARE(savedBreakpoints.at(0)->line(), 23); |
| 471 | QCOMPARE(savedBreakpoints.at(1)->line(), 24); |
| 472 | } |
| 473 | |
| 474 | void TestBreakpointModel::testDocumentEditAndDiscard() |
| 475 | { |