summaryrefslogtreecommitdiffstats
path: root/services/gitdiff/gitdiff_test.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-01-24 01:28:15 +0800
committerLauris BH <lauris@nix.lv>2020-01-23 19:28:15 +0200
commitf6067a8465e7762aea1561106cfee291409a0fd6 (patch)
tree35c97d4117acfe52dce32c9242e4c9a656c4bc6c /services/gitdiff/gitdiff_test.go
parentbfdfa9a8b32ae331f98137169693ba1d71c25b09 (diff)
downloadgitea-f6067a8465e7762aea1561106cfee291409a0fd6.tar.gz
gitea-f6067a8465e7762aea1561106cfee291409a0fd6.zip
Migrate reviews when migrating repository from github (#9463)
* fix typo * Migrate reviews when migrating repository from github * fix lint * Added test and migration when external user login * fix test * fix commented state * Some improvements * fix bug when get pull request and ref original author on code comments * Fix migrated line; Added comment for review * Don't load all pull requests attributes * Fix typo * wrong change copy head * fix tests * fix reactions * Fix test * fix fmt * fix review comment reactions
Diffstat (limited to 'services/gitdiff/gitdiff_test.go')
-rw-r--r--services/gitdiff/gitdiff_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/services/gitdiff/gitdiff_test.go b/services/gitdiff/gitdiff_test.go
index ea25b38dff..58604d97c4 100644
--- a/services/gitdiff/gitdiff_test.go
+++ b/services/gitdiff/gitdiff_test.go
@@ -209,3 +209,11 @@ func TestGetDiffRangeWithWhitespaceBehavior(t *testing.T) {
}
}
}
+
+func TestParseDiffHunkString(t *testing.T) {
+ leftLine, leftHunk, rightLine, rightHunk := ParseDiffHunkString("@@ -19,3 +19,5 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER")
+ assert.EqualValues(t, 19, leftLine)
+ assert.EqualValues(t, 3, leftHunk)
+ assert.EqualValues(t, 19, rightLine)
+ assert.EqualValues(t, 5, rightHunk)
+}