aboutsummaryrefslogtreecommitdiffstats
path: root/skate/url_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'skate/url_test.go')
-rw-r--r--skate/url_test.go20
1 files changed, 18 insertions, 2 deletions
diff --git a/skate/url_test.go b/skate/url_test.go
index d866e7a..1a439a6 100644
--- a/skate/url_test.go
+++ b/skate/url_test.go
@@ -8,6 +8,10 @@ func TestSanitizeURL(t *testing.T) {
out string
}{
{"", ""},
+ {"a", ""},
+ {"???", ""},
+ {"???***", ""},
+ {"???***___123", ""},
{"http://abc.com", "http://abc.com"},
{"http://!!abc.com", "http://abc.com"},
{`http://"www.phaelos.com/oubre.html`, `http://www.phaelos.com/oubre.html`},
@@ -108,6 +112,18 @@ func TestSanitizeURL(t *testing.T) {
`http://www.crd.york.ac.uk/PROSPERO/display_record.asp?ID=CRD42014009228`},
{`ftp://ftp.ncbi.nih.gov/genomes/Bacteria/`,
`ftp://ftp.ncbi.nih.gov/genomes/Bacteria/`},
+ {`ftp-eng.cisco.com/sobgp/index.html`,
+ `http://ftp-eng.cisco.com/sobgp/index.html`},
+ {`ftp.cdc.gov/pub/Publications/mmwr/SS/SS4703.pdf`,
+ `http://ftp.cdc.gov/pub/Publications/mmwr/SS/SS4703.pdf`},
+ {`ftpftp.inria.fr`,
+ `http://ftpftp.inria.fr`},
+ {`http.bglink.com/personal/batakovic`, `http://bglink.com/personal/batakovic`},
+ {`http.kalsel.bps.go.id`, `http://kalsel.bps.go.id`},
+ {`http.www.admhmao.ru/people/frame.htm`, `http://www.admhmao.ru/people/frame.htm`},
+ {`http.worldbank.org/sq`, `http://worldbank.org/sq`},
+ {`httpwww.sun.com`, `http://www.sun.com`},
+ {`httpswww.unos.org`, `http://www.unos.org`},
}
for _, c := range cases {
out := SanitizeURL(c.in)
@@ -122,8 +138,8 @@ func BenchmarkSanitizeURL(b *testing.B) {
name string
in string
}{
- {"http", `http://acrf.com.au/2012/world-firsthpv-vaccina-tion-plan-will-protect-young-australian-men-from-cancer/`},
- {"plain", `0.0.www.epcglobalinc.org/standards_technology/Secure/v1.0/UHF-class1.pdf`},
+ {`http`, `http://acrf.com.au/2012/world-firsthpv-vaccina-tion-plan-will-protect-young-australian-men-from-cancer/`},
+ {`plain`, `0.0.www.epcglobalinc.org/standards_technology/Secure/v1.0/UHF-class1.pdf`},
}
for _, bm := range bms {
b.Run(bm.name, func(b *testing.B) {