diff options
| author | Shulhan <ms@kilabit.info> | 2024-03-15 03:14:55 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2024-03-15 03:39:16 +0700 |
| commit | 72f2c183724199c2b749ec8efb59aa20b59d9e96 (patch) | |
| tree | 5c37a4637399d778703c6a2b3f26aeca333ca1e4 /lib/http/request_method_test.go | |
| parent | b9e12300d9050143fcfaa2193ad91842f035661f (diff) | |
| download | pakakeh.go-72f2c183724199c2b749ec8efb59aa20b59d9e96.tar.xz | |
lib/http: refactoring type of RequestMethod from int to string
The reason is to make storing or encoding the RequestMethod value readable
from user point of view instead of number, 0, 1, 2, etc.
Diffstat (limited to 'lib/http/request_method_test.go')
| -rw-r--r-- | lib/http/request_method_test.go | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/lib/http/request_method_test.go b/lib/http/request_method_test.go deleted file mode 100644 index 3723c6c4..00000000 --- a/lib/http/request_method_test.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2021, Shulhan <ms@kilabit.info>. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package http - -import ( - "testing" - - "git.sr.ht/~shulhan/pakakeh.go/lib/test" -) - -func TestRequestMethod_String(t *testing.T) { - cases := []struct { - exp string - m RequestMethod - }{ - {m: 0, exp: "GET"}, - {m: 1, exp: "CONNECT"}, - {m: 2, exp: "DELETE"}, - {m: 3, exp: "HEAD"}, - {m: 4, exp: "OPTIONS"}, - {m: 5, exp: "PATCH"}, - {m: 6, exp: "POST"}, - {m: 7, exp: "PUT"}, - {m: 8, exp: "TRACE"}, - {m: 9, exp: ""}, - {m: RequestMethodGet, exp: "GET"}, - {m: RequestMethodConnect, exp: "CONNECT"}, - {m: RequestMethodDelete, exp: "DELETE"}, - {m: RequestMethodHead, exp: "HEAD"}, - {m: RequestMethodOptions, exp: "OPTIONS"}, - {m: RequestMethodPatch, exp: "PATCH"}, - {m: RequestMethodPost, exp: "POST"}, - {m: RequestMethodPut, exp: "PUT"}, - {m: RequestMethodTrace, exp: "TRACE"}, - } - - for _, c := range cases { - test.Assert(t, "RequestMethod.String", c.exp, c.m.String()) - } -} |
