You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
forgejo/modules/validation
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.
5 years ago
..
binding.go Clean up ref name rules (#6437) 5 years ago
binding_test.go Fix lax comparison in validation tests (#7815) 5 years ago
helpers.go Validate External Tracker URL Format (#7089) 5 years ago
helpers_test.go Validate External Tracker URL Format (#7089) 5 years ago
refname_test.go Clean up ref name rules (#6437) 5 years ago
validurl_test.go Better URL validation (#1507) 7 years ago