aboutsummaryrefslogtreecommitdiff
path: root/lib/http/server_test.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2024-03-08 02:52:16 +0700
committerShulhan <ms@kilabit.info>2024-03-09 01:10:24 +0700
commit29343294a596fd74f6f9cb917c8aac74ccb78094 (patch)
treee9286ed53041b973cb6d767325034f30e504e1f5 /lib/http/server_test.go
parent4e35c509a41cecb207bf6f52e7c9a529fa9f71fb (diff)
downloadpakakeh.go-29343294a596fd74f6f9cb917c8aac74ccb78094.tar.xz
lib/http: refactoring NewServer and NewClient
The NewServer and NewClient now accept non-pointer options, so the caller unable to modify the options once the server or client has been created.
Diffstat (limited to 'lib/http/server_test.go')
-rw-r--r--lib/http/server_test.go14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/http/server_test.go b/lib/http/server_test.go
index f18b27c6..95995de5 100644
--- a/lib/http/server_test.go
+++ b/lib/http/server_test.go
@@ -950,7 +950,7 @@ func TestServer_Options_HandleFS(t *testing.T) {
func TestServer_handleRange(t *testing.T) {
var (
- clOpts = &ClientOptions{
+ clOpts = ClientOptions{
ServerURL: testServerURL,
}
cl = NewClient(clOpts)
@@ -1026,7 +1026,7 @@ func TestServer_handleRange(t *testing.T) {
func TestServer_handleRange_HEAD(t *testing.T) {
var (
- clOpts = &ClientOptions{
+ clOpts = ClientOptions{
ServerURL: testServerURL,
}
cl = NewClient(clOpts)
@@ -1129,15 +1129,11 @@ func TestServerHandleRangeBig(t *testing.T) {
}
var (
- clOpts = &ClientOptions{
+ clOpts = ClientOptions{
ServerURL: `http://` + serverAddress,
}
- cl *Client
- )
-
- cl = NewClient(clOpts)
+ cl = NewClient(clOpts)
- var (
tag = `HEAD /big`
skipHeaders = []string{HeaderDate}
@@ -1225,7 +1221,7 @@ func runServerFS(t *testing.T, address, dir string) (srv *Server) {
nodeBig.SetModTime(pathBigModTime)
var (
- srvOpts = &ServerOptions{
+ srvOpts = ServerOptions{
Memfs: mfs,
Address: address,
}