MCPcopy Create free account
hub / github.com/devploit/nomore403 / TestValidateURI

Function TestValidateURI

cmd/bypass_test.go:428–447  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

426}
427
428func TestValidateURI(t *testing.T) {
429 cases := []struct {
430 uri string
431 wantErr bool
432 }{
433 {"https://example.com/admin", false},
434 {"http://example.com/", false},
435 {"", true},
436 {"ftp://example.com", true},
437 {"not-a-url", true},
438 {"://missing-scheme", true},
439 }
440
441 for _, tc := range cases {
442 err := validateURI(tc.uri)
443 if (err != nil) != tc.wantErr {
444 t.Errorf("validateURI(%q): got err=%v, wantErr=%v", tc.uri, err, tc.wantErr)
445 }
446 }
447}
448
449func TestIsCalibrationMatch(t *testing.T) {
450 setVerbose(false)

Callers

nothing calls this directly

Calls 1

validateURIFunction · 0.85

Tested by

no test coverage detected