diff --git a/pkg/protocol/uri_unix_test.go b/pkg/protocol/uri_unix_test.go new file mode 100644 index 000000000..cc112b1e9 --- /dev/null +++ b/pkg/protocol/uri_unix_test.go @@ -0,0 +1,16 @@ +package protocol + +import ( + "github.com/cloudwego/hertz/pkg/common/test/assert" + "testing" +) + +func TestGetScheme(t *testing.T) { + scheme, path := getScheme([]byte("/file.go")) + assert.DeepEqual(t, "", string(scheme)) + assert.DeepEqual(t, "/file.go", string(path)) + + scheme, path = getScheme([]byte("https://foo.com")) + assert.DeepEqual(t, "https", string(scheme)) + assert.DeepEqual(t, "//foo.com", string(path)) +}