diff options
Diffstat (limited to 'skate/url_test.go')
-rw-r--r-- | skate/url_test.go | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/skate/url_test.go b/skate/url_test.go index 073509b..d866e7a 100644 --- a/skate/url_test.go +++ b/skate/url_test.go @@ -106,6 +106,8 @@ func TestSanitizeURL(t *testing.T) { `http://CRAN.R-project.org/package=vegan`}, {`CRD42014009228.www.crd.york.ac.uk/PROSPERO/display_record.asp?ID=CRD42014009228`, `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/`}, } for _, c := range cases { out := SanitizeURL(c.in) @@ -116,7 +118,18 @@ func TestSanitizeURL(t *testing.T) { } func BenchmarkSanitizeURL(b *testing.B) { - for n := 0; n < b.N; n++ { - SanitizeURL(`http://acrf.com.au/2012/world-firsthpv-vaccina-tion-plan-will-protect-young-australian-men-from-cancer/`) + var bms = []struct { + 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`}, + } + for _, bm := range bms { + b.Run(bm.name, func(b *testing.B) { + for n := 0; n < b.N; n++ { + SanitizeURL(bm.in) + } + }) } } |