-
Notifications
You must be signed in to change notification settings - Fork 546
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package protocol | ||
|
||
import ( | ||
Check failure on line 3 in pkg/protocol/uri_unix_test.go GitHub Actions / lint-and-ut (1.18)
Check failure on line 3 in pkg/protocol/uri_unix_test.go GitHub Actions / lint-and-ut (1.19)
|
||
"github.com/cloudwego/hertz/pkg/common/test/assert" | ||
Check failure on line 4 in pkg/protocol/uri_unix_test.go GitHub Actions / lint-and-ut (1.18)
Check failure on line 4 in pkg/protocol/uri_unix_test.go GitHub Actions / lint-and-ut (1.19)
|
||
"testing" | ||
Check failure on line 5 in pkg/protocol/uri_unix_test.go GitHub Actions / lint-and-ut (1.18)
Check failure on line 5 in pkg/protocol/uri_unix_test.go GitHub Actions / lint-and-ut (1.19)
|
||
) | ||
|
||
func TestGetScheme(t *testing.T) { | ||
Check failure on line 8 in pkg/protocol/uri_unix_test.go GitHub Actions / ut-windows (1.18)
|
||
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)) | ||
} |