1
0
mirror of https://github.com/golang/go synced 2024-11-21 16:54:46 -07:00

net/http: skip some test failed when httpmuxgo121=1

Signed-off-by: guoguangwu <guoguangwug@gmail.com>
This commit is contained in:
guoguangwu 2024-03-06 09:10:59 +08:00
parent 5dcc04aeac
commit 875b8a6bdf
2 changed files with 11 additions and 0 deletions

View File

@ -12,6 +12,7 @@ import (
"encoding/base64"
"errors"
"fmt"
"internal/godebug"
"io"
"math"
"mime/multipart"
@ -1535,6 +1536,9 @@ func TestSetPathValue(t *testing.T) {
}
func TestStatus(t *testing.T) {
if godebug.New("httpmuxgo121").Value() == "1" {
t.Skip("skipping test in TestStatus when httpmuxgo121=1")
}
// The main purpose of this test is to check 405 responses and the Allow header.
h := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {})
mux := NewServeMux()

View File

@ -8,6 +8,7 @@ package http
import (
"fmt"
"internal/godebug"
"net/url"
"regexp"
"testing"
@ -71,6 +72,9 @@ type handler struct{ i int }
func (handler) ServeHTTP(ResponseWriter, *Request) {}
func TestFindHandler(t *testing.T) {
if godebug.New("httpmuxgo121").Value() == "1" {
t.Skip("skipping test in TestFindHandler when httpmuxgo121=1")
}
mux := NewServeMux()
for _, ph := range []struct {
pat string
@ -133,6 +137,9 @@ func TestEmptyServeMux(t *testing.T) {
}
func TestRegisterErr(t *testing.T) {
if godebug.New("httpmuxgo121").Value() == "1" {
t.Skip("skipping test in TestRegisterErr when httpmuxgo121=1")
}
mux := NewServeMux()
h := &handler{}
mux.Handle("/a", h)