summaryrefslogtreecommitdiffstats
path: root/vendor/xorm.io
diff options
context:
space:
mode:
authorWGH <wgh@torlan.ru>2019-08-12 05:17:25 +0300
committerLunny Xiao <xiaolunwen@gmail.com>2019-08-12 10:17:25 +0800
commit98fd085039fe6c392ecf68298f3ad41e87950cd3 (patch)
treeff019c0f67e1d3773172f97302cfbed1f1fd9df0 /vendor/xorm.io
parente9bb75d8d18ba88dc26e4c4af6dc66812a9b8fb6 (diff)
downloadgitea-98fd085039fe6c392ecf68298f3ad41e87950cd3.tar.gz
gitea-98fd085039fe6c392ecf68298f3ad41e87950cd3.zip
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.
Diffstat (limited to 'vendor/xorm.io')
0 files changed, 0 insertions, 0 deletions