Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for TestPool (0.44 sec)

  1. src/sync/pool_test.go

    	}
    }
    
    // Test that Pool does not hold pointers to previously cached resources.
    func TestPoolGC(t *testing.T) {
    	testPool(t, true)
    }
    
    // Test that Pool releases resources on GC.
    func TestPoolRelease(t *testing.T) {
    	testPool(t, false)
    }
    
    func testPool(t *testing.T, drain bool) {
    	var p Pool
    	const N = 100
    loop:
    	for try := 0; try < 3; try++ {
    		if try == 1 && testing.Short() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 8K bytes
    - Viewed (0)
  2. pkg/cmd/flag_test.go

    func TestInitializeBoolFlag(t *testing.T) {
    	cmd := &cobra.Command{}
    	var testBool bool
    	flag.BoolVar(&testBool, "testbool", defaultBool, "test bool flag")
    	AddFlags(cmd)
    
    	testName := "Initialize bool Flag"
    	if !flag.Parsed() {
    		t.Errorf("%s: flag.Parsed() returns false, should be true", testName)
    	}
    
    	cmd.Flags().VisitAll(func(f *pflag.Flag) {
    		if f.Name != "testbool" {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 29 20:42:01 UTC 2020
    - 3.4K bytes
    - Viewed (0)
  3. pkg/env/var_test.go

    		t.Errorf("Expected 789, got %v", v)
    	}
    	if !present {
    		t.Errorf("Expected present")
    	}
    
    	v = ev.Get()
    	if v != 789 {
    		t.Errorf("Expected 789, got %v", v)
    	}
    }
    
    func TestBool(t *testing.T) {
    	reset()
    
    	ev := RegisterBoolVar(testVar, true, "")
    	v, present := ev.Lookup()
    	if !v {
    		t.Errorf("Expected true, got %v", v)
    	}
    	if present {
    		t.Errorf("Expected not present")
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Aug 08 16:43:05 UTC 2023
    - 8.1K bytes
    - Viewed (0)
Back to top