From 06b8a5d62163363ef685388bd1eb5e20178a9b05 Mon Sep 17 00:00:00 2001 From: Skyenought Date: Mon, 20 Nov 2023 15:47:15 +0800 Subject: [PATCH] add uri_unix_test.go --- pkg/protocol/uri_unix_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 pkg/protocol/uri_unix_test.go 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)) +}