You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
780 B
35 lines
780 B
package normalize |
|
|
|
import ( |
|
"fmt" |
|
"testing" |
|
) |
|
|
|
func TestURL(t *testing.T) { |
|
fmt.Println(URL([]byte(""))) |
|
fmt.Println(URL([]byte("wss://x.com/y"))) |
|
fmt.Println(URL([]byte("wss://x.com/y/"))) |
|
fmt.Println(URL([]byte("http://x.com/y"))) |
|
fmt.Println(URL(URL([]byte("http://x.com/y")))) |
|
fmt.Println(URL([]byte("wss://x.com"))) |
|
fmt.Println(URL([]byte("wss://x.com/"))) |
|
fmt.Println(URL(URL(URL([]byte("wss://x.com/"))))) |
|
fmt.Println(URL([]byte("x.com"))) |
|
fmt.Println(URL([]byte("x.com/"))) |
|
fmt.Println(URL([]byte("x.com////"))) |
|
fmt.Println(URL([]byte("x.com/?x=23"))) |
|
|
|
// Output: |
|
// |
|
// wss://x.com/y |
|
// wss://x.com/y |
|
// ws://x.com/y |
|
// ws://x.com/y |
|
// wss://x.com |
|
// wss://x.com |
|
// wss://x.com |
|
// wss://x.com |
|
// wss://x.com |
|
// wss://x.com |
|
// wss://x.com?x=23 |
|
}
|
|
|