add initial failing test for cleanURL

This commit is contained in:
swaits committed 2015-02-15 08:20:00 -08:00
1 parent 5cad35e382
commit 42799df06e
2 files changed
+19

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
package main
// scheme://[userinfo@]host/path[?query][#fragment]
+16
View File
@@ -0,0 +1,16 @@
package main
import (
"testing"
)
// TestURLCleaner tests cleaning up (regularization) of URLs
func TestURLCleaner(t *testing.T) {
host, url := cleanURL("http://swaits:pass@someHOST.com:8765/blah/blah.html?x=y#foo")
if host != "somehost.com" {
t.Error("host extraction failed")
}
if url != "http://swaits:pass@somehost.com:8765/blah/blah.html?x=y#foo" {
t.Error("url cleanup failed")
}
}