Skip to content

Commit

Permalink
增加一个测试用例
Browse files Browse the repository at this point in the history
  • Loading branch information
karldoenitz committed Oct 15, 2023
1 parent dabd88e commit 82b340c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test_case/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package test_case

import (
"Tigo/TigoWeb"
"strings"
"testing"
)

Expand All @@ -24,3 +25,21 @@ func TestEncryptDecrypt(t *testing.T) {
}
t.Log("success")
}

func TestMethodEnum(t *testing.T) {
methods := []string{
"get", "head", "put", "post", "delete", "connect", "options", "trace",
}
for _, method := range methods {
m := strings.ToUpper(string(method[0])) + method[1:]
if TigoWeb.MethodEnum(method) != m {
t.Error("MethodEnum test failed")
return
}
if TigoWeb.MethodEnum(strings.ToLower(method)) != m {
t.Error("MethodEnum test failed")
return
}
}
t.Log("success")
}

0 comments on commit 82b340c

Please sign in to comment.