MCPcopy
hub / github.com/revel/revel / TestURL

Function TestURL

validators_test.go:475–496  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

473}
474
475func TestURL(t *testing.T) {
476 test_urls := map[string]bool{
477 "https://www.google.co.kr/url?sa=t&rct=j&q=&esrc=s&source=web": true,
478 "http://stackoverflow.com/questions/27812164/can-i-import-3rd-party-package-into-golang-playground": true,
479 "https://tour.golang.org/welcome/4": true,
480 "https://revel.github.io/": true,
481 "https://github.com/revel/revel/commit/bd1d083ee4345e919b3bca1e4c42ca682525e395#diff-972a2b2141d27e9d7a8a4149a7e28eef": true,
482 "https://github.com/ndevilla/iniparser/pull/82#issuecomment-261817064": true,
483 "http://www.baidu.com/s?ie=utf-8&f=8&rsv_bp=0&rsv_idx=1&tn=baidu&wd=golang": true,
484 "http://www.baidu.com/link?url=DrWkM_beo2M5kB5sLYnItKSQ0Ib3oDhKcPprdtLzAWNfFt_VN5oyD3KwnAKT6Xsk": true,
485 }
486
487 tests := []Expect{}
488
489 for url, expected := range test_urls {
490 tests = append(tests, Expect{input: url, expectedResult: expected, errorMessage: fmt.Sprintf("invalid (%s) url", url)})
491 }
492
493 for _, url := range []revel.URL{{}, revel.ValidURL()} {
494 performTests(url, tests, t)
495 }
496}
497
498func TestPureTextNormal(t *testing.T) {
499 test_txts := map[string]bool{

Callers

nothing calls this directly

Calls 2

ValidURLFunction · 0.92
performTestsFunction · 0.85

Tested by

no test coverage detected