aboutsummaryrefslogtreecommitdiff
path: root/lib/http/request_method_test.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2024-03-08 02:19:18 +0700
committerShulhan <ms@kilabit.info>2024-03-09 01:10:24 +0700
commit4e35c509a41cecb207bf6f52e7c9a529fa9f71fb (patch)
tree4fda47608b7a226afed77344003ab8e8f1a4788d /lib/http/request_method_test.go
parentd309b58f63cfc382e0003cff85ab057fd06d3d23 (diff)
downloadpakakeh.go-4e35c509a41cecb207bf6f52e7c9a529fa9f71fb.tar.xz
lib/http: rename files for consistency
If the type is in CamelCase the file should be using snake_case.
Diffstat (limited to 'lib/http/request_method_test.go')
-rw-r--r--lib/http/request_method_test.go42
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/http/request_method_test.go b/lib/http/request_method_test.go
new file mode 100644
index 00000000..3723c6c4
--- /dev/null
+++ b/lib/http/request_method_test.go
@@ -0,0 +1,42 @@
+// 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())
+ }
+}