diff options
author | zeripath <art27@cantab.net> | 2020-06-18 15:07:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-18 10:07:09 -0400 |
commit | 654a97064495213531efdfc2571f659b45236633 (patch) | |
tree | fa2f298c4b7c289d618940582515751189b4c0da /integrations/api_pull_review_test.go | |
parent | 1dd3f19ee381d3a3554828a37282fd75ba3073ee (diff) | |
download | gitea-654a97064495213531efdfc2571f659b45236633.tar.gz gitea-654a97064495213531efdfc2571f659b45236633.zip |
Fix commenting on non-utf8 encoded files (#11916)
* Add comment on non-unicode line to force fail
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Just quote/unquote patch
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'integrations/api_pull_review_test.go')
-rw-r--r-- | integrations/api_pull_review_test.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/integrations/api_pull_review_test.go b/integrations/api_pull_review_test.go index c90a5c11cd..611b34712c 100644 --- a/integrations/api_pull_review_test.go +++ b/integrations/api_pull_review_test.go @@ -86,6 +86,11 @@ func TestAPIPullReview(t *testing.T) { Body: "first old line", OldLineNum: 1, NewLineNum: 0, + }, { + Path: "iso-8859-1.txt", + Body: "this line contains a non-utf-8 character", + OldLineNum: 0, + NewLineNum: 1, }, }, }) @@ -93,7 +98,7 @@ func TestAPIPullReview(t *testing.T) { DecodeJSON(t, resp, &review) assert.EqualValues(t, 6, review.ID) assert.EqualValues(t, "PENDING", review.State) - assert.EqualValues(t, 2, review.CodeCommentsCount) + assert.EqualValues(t, 3, review.CodeCommentsCount) // test SubmitPullReview req = NewRequestWithJSON(t, http.MethodPost, fmt.Sprintf("/api/v1/repos/%s/%s/pulls/%d/reviews/%d?token=%s", repo.OwnerName, repo.Name, pullIssue.Index, review.ID, token), &api.SubmitPullReviewOptions{ @@ -104,7 +109,7 @@ func TestAPIPullReview(t *testing.T) { DecodeJSON(t, resp, &review) assert.EqualValues(t, 6, review.ID) assert.EqualValues(t, "APPROVED", review.State) - assert.EqualValues(t, 2, review.CodeCommentsCount) + assert.EqualValues(t, 3, review.CodeCommentsCount) // test DeletePullReview req = NewRequestWithJSON(t, http.MethodPost, fmt.Sprintf("/api/v1/repos/%s/%s/pulls/%d/reviews?token=%s", repo.OwnerName, repo.Name, pullIssue.Index, token), &api.CreatePullReviewOptions{ |