optimize websocket step

This commit is contained in:
buyuxiang
2022-07-11 18:25:43 +08:00
parent 85d43e0483
commit a347a381b3
6 changed files with 278 additions and 119 deletions

View File

@@ -49,6 +49,22 @@ func TestBuildURL(t *testing.T) {
if !assert.Equal(t, url, "https://httpbin.org/get") {
t.Fatal()
}
// websocket url
url = buildURL("wss://ws.postman-echo.com/raw", "")
if !assert.Equal(t, url, "wss://ws.postman-echo.com/raw") {
t.Fatal()
}
url = buildURL("wss://ws.postman-echo.com", "/raw")
if !assert.Equal(t, url, "wss://ws.postman-echo.com/raw") {
t.Fatal()
}
url = buildURL("wss://ws.postman-echo.com/raw", "ws://echo.websocket.events")
if !assert.Equal(t, url, "ws://echo.websocket.events") {
t.Fatal()
}
}
func TestRegexCompileVariable(t *testing.T) {