Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unsed mux test structs #705

Merged
merged 1 commit into from Feb 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 0 additions & 48 deletions mux_test.go
Expand Up @@ -9,7 +9,6 @@ import (
"net"
"net/http"
"net/http/httptest"
"os"
"sync"
"testing"
"time"
Expand Down Expand Up @@ -1753,53 +1752,6 @@ func testHandler(t *testing.T, h http.Handler, method, path string, body io.Read
return w.Result(), w.Body.String()
}

type testFileSystem struct {
open func(name string) (http.File, error)
}

func (fs *testFileSystem) Open(name string) (http.File, error) {
return fs.open(name)
}

type testFile struct {
name string
contents []byte
}

func (tf *testFile) Close() error {
return nil
}

func (tf *testFile) Read(p []byte) (n int, err error) {
copy(p, tf.contents)
return len(p), nil
}

func (tf *testFile) Seek(offset int64, whence int) (int64, error) {
return 0, nil
}

func (tf *testFile) Readdir(count int) ([]os.FileInfo, error) {
stat, _ := tf.Stat()
return []os.FileInfo{stat}, nil
}

func (tf *testFile) Stat() (os.FileInfo, error) {
return &testFileInfo{tf.name, int64(len(tf.contents))}, nil
}

type testFileInfo struct {
name string
size int64
}

func (tfi *testFileInfo) Name() string { return tfi.name }
func (tfi *testFileInfo) Size() int64 { return tfi.size }
func (tfi *testFileInfo) Mode() os.FileMode { return 0755 }
func (tfi *testFileInfo) ModTime() time.Time { return time.Now() }
func (tfi *testFileInfo) IsDir() bool { return false }
func (tfi *testFileInfo) Sys() interface{} { return nil }

type ctxKey struct {
name string
}
Expand Down