This repository has been archived on 2024-01-04. You can view files and clone it, but cannot push or open issues or pull requests.
forgejo/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
base
cache
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
git Be more strict with git arguments (#7715) 2019-08-05 21:39:39 +01:00
gzip
highlight Add a lot of extension to language mappings for syntax highlights (#7741) 2019-08-05 23:48:31 +08:00
httplib
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
markup Removed unnecessary conversions (#7557) 2019-07-23 19:50:39 +01:00
metrics
migrations fix bug on migrating milestone from github (#7665) 2019-07-29 16:41:22 +01:00
minwinsvc
notification
options remove unnecessary fmt on generate bindata (#7706) 2019-08-01 13:34:46 -04:00
pprof
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
repofiles Fix duplicate call of webhook (#7821) 2019-08-11 23:31:18 +03:00
search
secret
session
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
upload Refactor filetype is not allowed errors (#7309) 2019-07-06 22:25:05 -04:00
user
util
validation Fix lax comparison in validation tests (#7815) 2019-08-12 10:17:25 +08:00