mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-16 07:59:11 +00:00
98fd085039
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. |
||
---|---|---|
.. | ||
binding.go | ||
binding_test.go | ||
helpers.go | ||
helpers_test.go | ||
refname_test.go | ||
validurl_test.go |