0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-27 02:04:22 +01:00
gitea/modules
WGH 98fd085039 Fix lax comparison in validation tests (#7815)
If you add t.Logf("%+v %+v", actual, testCase.expectedErrors) to
the test code, you'll notice that only Errors' Messages are being
compared:

    --- PASS: Test_ValidURLValidation/Invalid_schema (0.00s)
    binding_test.go:43: [Url] [Url]

FieldNames and Classification are ignored in comparison.

Moreover, an Errors slice with a single Error with empty message
is formatted as '[]' (the same as empty slice), which is also
error-prone. I discovered this when working on #7791 when one test which
was not supposed to pass did pass. https://play.golang.org/p/qC4wVLrm4NG

This commit changes the test to do the comparison properly.
2019-08-12 10:17:25 +08:00
..
auth Make captcha and password optional for external accounts (#6606) 2019-07-06 15:48:02 -04:00
avatar Improve handling of non-square avatars (#7025) 2019-05-25 14:46:14 +03:00
base API error cleanup (#7186) 2019-06-12 17:07:24 -04:00
cache Add golangci (#6418) 2019-06-12 15:41:28 -04:00
context Removed unnecessary conversions (#7557) 2019-07-23 19:50:39 +01:00
cron Move status table to cron package (#7370) 2019-07-15 20:13:03 -04:00
generate Integrate OAuth2 Provider (#5378) 2019-03-08 11:42:50 -05:00
git Be more strict with git arguments (#7715) 2019-08-05 21:39:39 +01:00
gzip Add golangci (#6418) 2019-06-12 15:41:28 -04:00
highlight Add a lot of extension to language mappings for syntax highlights (#7741) 2019-08-05 23:48:31 +08:00
httplib Add golangci (#6418) 2019-06-12 15:41:28 -04:00
indexer Remove camel case tokenization from repo indexer (#7733) 2019-08-06 07:38:16 +03:00
lfs Removed unnecessary conversions (#7557) 2019-07-23 19:50:39 +01:00
log Removed unnecessary conversions (#7557) 2019-07-23 19:50:39 +01:00
mailer Add golangci (#6418) 2019-06-12 15:41:28 -04:00
markup Removed unnecessary conversions (#7557) 2019-07-23 19:50:39 +01:00
metrics Prometheus endpoint (#5256) 2018-11-04 22:20:00 -05:00
migrations fix bug on migrating milestone from github (#7665) 2019-07-29 16:41:22 +01:00
minwinsvc
notification Add golangci (#6418) 2019-06-12 15:41:28 -04:00
options remove unnecessary fmt on generate bindata (#7706) 2019-08-01 13:34:46 -04:00
pprof Add golangci (#6418) 2019-06-12 15:41:28 -04:00
private #6946 Run hooks on merge/edit and cope with protected branches (#6961) 2019-07-01 09:18:13 +08:00
process
public remove unnecessary fmt on generate bindata (#7706) 2019-08-01 13:34:46 -04:00
pull Fix duplicate call of webhook (#7821) 2019-08-11 23:31:18 +03:00
recaptcha Allow Recaptcha service url to be configured (#6820) 2019-05-02 16:09:39 +03:00
repofiles Fix duplicate call of webhook (#7821) 2019-08-11 23:31:18 +03:00
search Global code search support (#3664) 2018-03-16 22:04:33 +08:00
secret Integrate OAuth2 Provider (#5378) 2019-03-08 11:42:50 -05:00
session Add golangci (#6418) 2019-06-12 15:41:28 -04:00
setting Remove settting dependency on modules/session (#7237) 2019-07-17 09:04:37 +08:00
ssh switch to use gliderlabs/ssh for builtin server (#7250) 2019-07-06 21:28:09 -04:00
structs Be more strict with git arguments (#7715) 2019-08-05 21:39:39 +01:00
sync
templates remove unnecessary fmt on generate bindata (#7706) 2019-08-01 13:34:46 -04:00
test move code.gitea.io/git to code.gitea.io/gitea/modules/git (#6364) 2019-03-27 17:33:00 +08:00
upload Refactor filetype is not allowed errors (#7309) 2019-07-06 22:25:05 -04:00
user Add golangci (#6418) 2019-06-12 15:41:28 -04:00
util Handle insecure and ports in go get (#7041) 2019-05-27 22:08:38 +01:00
validation Fix lax comparison in validation tests (#7815) 2019-08-12 10:17:25 +08:00