mirror of
https://github.com/Murmele/Gittyup.git
synced 2024-09-17 13:37:18 +03:00
add additional tests
This commit is contained in:
parent
2796e5416a
commit
f415020282
@ -112,8 +112,11 @@ private slots:
|
||||
void windowsCRLF();
|
||||
#endif // Q_OS_WIN
|
||||
|
||||
#endif // EXECUTE_ONLY_LAST_TEST == 0
|
||||
void windowsCRLFMultiHunk();
|
||||
#endif // EXECUTE_ONLY_LAST_TEST == 0
|
||||
|
||||
void sameContentRemoveLine();
|
||||
void sameContentAddLine();
|
||||
|
||||
private:
|
||||
int closeDelay = 0;
|
||||
@ -854,8 +857,6 @@ void TestEditorLineInfo::windowsCRLF() {
|
||||
}
|
||||
#endif // Q_OS_WIN
|
||||
|
||||
#endif
|
||||
|
||||
void TestEditorLineInfo::windowsCRLFMultiHunk() {
|
||||
/*
|
||||
* Staging single lines in a file with CRLF instead of single LF for multiple
|
||||
@ -917,6 +918,37 @@ void TestEditorLineInfo::windowsCRLFMultiHunk() {
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void TestEditorLineInfo::sameContentRemoveLine() {
|
||||
INIT_REPO("16_LinestagingLineContent.zip", true)
|
||||
QVERIFY(stagedDiff.count() > 0);
|
||||
QVERIFY(diff.count() > 0);
|
||||
git::Patch patch = diff.patch(0);
|
||||
git::Patch stagedPatch = stagedDiff.patch(0);
|
||||
|
||||
auto hw = HunkWidget(&diffView, diff, patch, stagedPatch, 0, false, false,
|
||||
repoView);
|
||||
hw.load(stagedPatch, true);
|
||||
checkEditorMarkers(hw.editor(), QVector<int>({3, 4, 5, 12, 13, 21, 22}),
|
||||
QVector<int>(), QVector<int>({11, 19, 20}),
|
||||
QVector<int>({10}));
|
||||
}
|
||||
|
||||
void TestEditorLineInfo::sameContentAddLine() {
|
||||
INIT_REPO("17_LinestagingLineContentStageAddedLine.zip", true)
|
||||
QVERIFY(stagedDiff.count() > 0);
|
||||
QVERIFY(diff.count() > 0);
|
||||
git::Patch patch = diff.patch(0);
|
||||
git::Patch stagedPatch = stagedDiff.patch(0);
|
||||
|
||||
auto hw = HunkWidget(&diffView, diff, patch, stagedPatch, 0, false, false,
|
||||
repoView);
|
||||
hw.load(stagedPatch, true);
|
||||
checkEditorMarkers(hw.editor(), QVector<int>({3, 4}), QVector<int>({9}),
|
||||
QVector<int>({}), QVector<int>({}));
|
||||
}
|
||||
|
||||
void TestEditorLineInfo::cleanupTestCase() { qWait(closeDelay); }
|
||||
|
||||
TEST_MAIN(TestEditorLineInfo)
|
||||
|
BIN
test/testRepos/16_LinestagingLineContent.zip
Normal file
BIN
test/testRepos/16_LinestagingLineContent.zip
Normal file
Binary file not shown.
BIN
test/testRepos/17_LinestagingLineContentStageAddedLine.zip
Normal file
BIN
test/testRepos/17_LinestagingLineContentStageAddedLine.zip
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user