Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for wantbool (0.19 sec)

  1. src/database/sql/convert_test.go

    		// True bools
    		{s: true, d: &scanbool, wantbool: true},
    		{s: "True", d: &scanbool, wantbool: true},
    		{s: "TRUE", d: &scanbool, wantbool: true},
    		{s: "1", d: &scanbool, wantbool: true},
    		{s: 1, d: &scanbool, wantbool: true},
    		{s: int64(1), d: &scanbool, wantbool: true},
    		{s: uint16(1), d: &scanbool, wantbool: true},
    
    		// False bools
    		{s: false, d: &scanbool, wantbool: false},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 10 20:23:22 UTC 2024
    - 17K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/endpoints/handlers/responsewriters/writers_test.go

    		wantCode    int
    		wantHeaders http.Header
    		wantBody    []byte
    	}{
    		{
    			name:        "serialize object",
    			out:         smallPayload,
    			req:         &http.Request{Header: http.Header{}, URL: &url.URL{Path: "/path"}},
    			wantCode:    http.StatusOK,
    			wantHeaders: http.Header{"Content-Type": []string{""}},
    			wantBody:    smallPayload,
    		},
    
    		{
    			name:        "return content type",
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 15.7K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/validation_test.go

    		func(s *JSON, c fuzz.Continue) {
    			if c.RandBool() {
    				s.Object = float64(42.0)
    			}
    		},
    		func(s **StructuralOrBool, c fuzz.Continue) {
    			if c.RandBool() {
    				*s = &StructuralOrBool{}
    			}
    		},
    		func(s **Structural, c fuzz.Continue) {
    			if c.RandBool() {
    				*s = &Structural{}
    			}
    		},
    		func(s *Structural, c fuzz.Continue) {
    			if c.RandBool() {
    				*s = Structural{}
    			}
    		},
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 31 18:20:00 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  4. src/net/http/clientserver_test.go

    func testHandlerWritesTooMuch(t *testing.T, mode testMode) {
    	wantBody := []byte("123")
    	cst := newClientServerTest(t, mode, HandlerFunc(func(w ResponseWriter, r *Request) {
    		rc := NewResponseController(w)
    		w.Header().Set("Content-Length", fmt.Sprintf("%v", len(wantBody)))
    		rc.Flush()
    		w.Write(wantBody)
    		rc.Flush()
    		n, err := io.WriteString(w, "x") // too many
    		if err == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 46.6K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apimachinery/pkg/apis/meta/fuzzer/fuzzer.go

    			*q = *resource.NewQuantity(c.Int63n(1000), resource.DecimalExponent)
    		},
    		func(j *int, c fuzz.Continue) {
    			*j = int(c.Int31())
    		},
    		func(j **int, c fuzz.Continue) {
    			if c.RandBool() {
    				i := int(c.Int31())
    				*j = &i
    			} else {
    				*j = nil
    			}
    		},
    		func(j *runtime.TypeMeta, c fuzz.Continue) {
    			// We have to customize the randomization of TypeMetas because their
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 03 15:12:26 UTC 2024
    - 9.9K bytes
    - Viewed (0)
  6. src/net/http/fs_test.go

    		}
    		body, err := io.ReadAll(res.Body)
    		res.Body.Close()
    		if err != nil {
    			t.Fatal(err)
    		}
    		wantBody := file
    		if method == MethodHead {
    			wantBody = nil
    		}
    		if !bytes.Equal(body, wantBody) {
    			t.Fatalf("%v: got body %q, want %q", method, body, wantBody)
    		}
    		if got, want := res.Header.Get("Content-Length"), fmt.Sprint(len(file)); got != want {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 23:39:44 UTC 2024
    - 49.9K bytes
    - Viewed (0)
  7. src/go/build/deps_test.go

    	if err != nil {
    		t.Fatal(err)
    	}
    	t.Logf("go/build imports %q", imports)
    	want := []string{"bytes", "os", "path/filepath", "strings"}
    wantLoop:
    	for _, w := range want {
    		for _, imp := range imports {
    			if imp == w {
    				continue wantLoop
    			}
    		}
    		t.Errorf("expected to find %q in import list", w)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 16:41:13 UTC 2024
    - 19.2K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apimachinery/pkg/api/resource/quantity_test.go

    			t.Errorf("%#v: expected %v, got %v (%#v)", item.in, e, a, q.i)
    		}
    	}
    }
    
    var fuzzer = fuzz.New().Funcs(
    	func(q *Quantity, c fuzz.Continue) {
    		q.i = Zero
    		if c.RandBool() {
    			q.Format = BinarySI
    			if c.RandBool() {
    				dec := &inf.Dec{}
    				q.d = infDecAmount{Dec: dec}
    				dec.SetScale(0)
    				dec.SetUnscaled(c.Int63())
    				return
    			}
    			// Be sure to test cases like 1Mi
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 21:48:10 UTC 2024
    - 49.4K bytes
    - Viewed (0)
  9. src/net/http/client_test.go

    		t.Fatal(err)
    	}
    	defer resp.Body.Close()
    	if resp.StatusCode != 200 {
    		t.Fatal(resp.Status)
    	}
    	if got, err := io.ReadAll(resp.Body); err != nil || string(got) != wantBody {
    		t.Errorf("body = %q; want %q", got, wantBody)
    	}
    }
    
    // Issue 17494: cookies should be altered when Client follows redirects.
    func TestClientAltersCookiesOnRedirect(t *testing.T) { run(t, testClientAltersCookiesOnRedirect) }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:30:50 UTC 2024
    - 63.8K bytes
    - Viewed (0)
  10. src/net/http/serve_test.go

    			t.Errorf("%q. unexpected error: %v", badTE, err)
    			continue
    		}
    
    		wantBody := fmt.Sprintf("" +
    			"HTTP/1.1 501 Not Implemented\r\nContent-Type: text/plain; charset=utf-8\r\n" +
    			"Connection: close\r\n\r\nUnsupported transfer encoding")
    
    		if string(gotBody) != wantBody {
    			t.Errorf("%q. body\ngot\n%q\nwant\n%q", badTE, gotBody, wantBody)
    		}
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 17:57:01 UTC 2024
    - 202K bytes
    - Viewed (0)
Back to top