diff options
| author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2014-07-28 12:15:01 +0300 |
|---|---|---|
| committer | Orgad Shaneh <orgads@gmail.com> | 2014-07-28 11:21:01 +0200 |
| commit | 7d3d80a6d5c054a449ac4105c8bd1b1e2d8c66b9 (patch) | |
| tree | 7df187631fa06f6625b31a7fbe0160199e50ba81 | |
| parent | b117efc5948a31b195fa651792a35592fc87346c (diff) | |
| download | qt-creator-7d3d80a6d5c054a449ac4105c8bd1b1e2d8c66b9.tar.gz | |
DiffEditor: Add a failing test for regression
Task-number: QTCREATORBUG-12665
Change-Id: I02f4a9d3444e775049e1712a1dd985b95dc874f3
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
| -rw-r--r-- | src/plugins/diffeditor/diffeditorplugin.cpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/plugins/diffeditor/diffeditorplugin.cpp b/src/plugins/diffeditor/diffeditorplugin.cpp index 3879297661..4b99681e88 100644 --- a/src/plugins/diffeditor/diffeditorplugin.cpp +++ b/src/plugins/diffeditor/diffeditorplugin.cpp @@ -699,6 +699,55 @@ void DiffEditor::Internal::DiffEditorPlugin::testReadPatch_data() QTest::newRow("Last newline added to a line without newline") << patch << fileDataList3; + + patch = _("diff --git a/difftest.txt b/difftest.txt\n" + "index 1234567..9876543 100644\n" + "--- a/difftest.txt\n" + "+++ b/difftest.txt\n" + "@@ -2,5 +2,5 @@ void func()\n" + " A\n" + " B\n" + "-C\n" + "+Z\n" + " D\n" + " \n" + "@@ -9,2 +9,4 @@ void OtherFunc()\n" + " \n" + " D\n" + "+E\n" + "+F\n" + ); + + fileData1.leftFileInfo = DiffFileInfo(_("difftest.txt"), _("1234567")); + fileData1.rightFileInfo = DiffFileInfo(_("difftest.txt"), _("9876543")); + fileData1.fileOperation = FileData::ChangeFile; + chunkData1.leftStartingLineNumber = 1; + chunkData1.rightStartingLineNumber = 1; + rows1.clear(); + rows1 << RowData(_("A")); + rows1 << RowData(_("B")); + rows1 << RowData(_("C"), _("Z")); + rows1 << RowData(_("D")); + rows1 << RowData(_("")); + chunkData1.rows = rows1; + + chunkData2.leftStartingLineNumber = 8; + chunkData2.rightStartingLineNumber = 8; + rows2.clear(); + rows2 << RowData(_("")); + rows2 << RowData(_("D")); + rows2 << RowData(TextLineData::Separator, _("E")); + rows2 << RowData(TextLineData::Separator, _("F")); + chunkData2.rows = rows2; + fileData1.chunks.clear(); + fileData1.chunks << chunkData1; + fileData1.chunks << chunkData2; + + QList<FileData> fileDataList4; + fileDataList4 << fileData1; + + QTest::newRow("2 chunks - first ends with blank line") << patch + << fileDataList4; } void DiffEditor::Internal::DiffEditorPlugin::testReadPatch() @@ -726,6 +775,7 @@ void DiffEditor::Internal::DiffEditorPlugin::testReadPatch() QCOMPARE(resultChunkData.leftStartingLineNumber, origChunkData.leftStartingLineNumber); QCOMPARE(resultChunkData.rightStartingLineNumber, origChunkData.rightStartingLineNumber); QCOMPARE(resultChunkData.contextChunk, origChunkData.contextChunk); + QEXPECT_FAIL("2 chunks - first ends with blank line", "QTCREATORBUG-12665", Abort); QCOMPARE(resultChunkData.rows.count(), origChunkData.rows.count()); for (int k = 0; k < origChunkData.rows.count(); k++) { const RowData &origRowData = origChunkData.rows.at(k); |
