add initial failing test for cleanURL
This commit is contained in:
1 parent
5cad35e382
commit
42799df06e
2 files changed
+19
No files matched your search
@@ -0,0 +1,3 @@
|
||||
package main
|
||||
|
||||
// scheme://[userinfo@]host/path[?query][#fragment]
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user