Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 1,281 for testCases (0.31 sec)

  1. cmd/net_test.go

    		{"http://8.8.8.8:9000", "http://localhost:9000", false, nil},
    	}
    
    	for _, testCase := range testCases {
    		testCase := testCase
    		t.Run("", func(t *testing.T) {
    			sameAddr, err := sameLocalAddrs(testCase.addr1, testCase.addr2)
    			if testCase.expectedErr != nil && err == nil {
    				t.Errorf("should fail but succeeded")
    			}
    			if testCase.expectedErr == nil && err != nil {
    				t.Errorf("should succeed but failed with %v", err)
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Apr 19 08:43:09 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  2. pkg/apis/core/helper/helpers_test.go

    			result:   false,
    		},
    	}
    	for _, testCase := range testCases {
    		if testCase.result != IsHugePageResourceValueDivisible(testCase.name, testCase.quantity) {
    			t.Errorf("resource: %v storage:%v expected result: %v", testCase.name, testCase.quantity, testCase.result)
    		}
    	}
    }
    
    func TestHugePageResourceName(t *testing.T) {
    	testCases := []struct {
    		pageSize resource.Quantity
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Oct 28 07:31:28 UTC 2023
    - 9.2K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/quota/v1/resources_test.go

    			},
    			expected: false,
    		},
    	}
    	for testName, testCase := range testCases {
    		if result := Equals(testCase.a, testCase.b); result != testCase.expected {
    			t.Errorf("%s expected: %v, actual: %v, a=%v, b=%v", testName, testCase.expected, result, testCase.a, testCase.b)
    		}
    	}
    }
    
    func TestLessThanOrEqual(t *testing.T) {
    	testCases := map[string]struct {
    		a        corev1.ResourceList
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Apr 12 01:57:38 UTC 2021
    - 15.6K bytes
    - Viewed (0)
  4. internal/event/name_test.go

    	}
    
    	for i, testCase := range testCases {
    		data, err := json.Marshal(testCase.name)
    		expectErr := (err != nil)
    
    		if expectErr != testCase.expectErr {
    			t.Fatalf("test %v: error: expected: %v, got: %v", i+1, testCase.expectErr, expectErr)
    		}
    
    		if !testCase.expectErr {
    			if !reflect.DeepEqual(data, testCase.expectedData) {
    				t.Fatalf("test %v: data: expected: %v, got: %v", i+1, string(testCase.expectedData), string(data))
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed May 01 01:11:10 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  5. pkg/proxy/util/utils_test.go

    			port:   12345,
    			expect: "[fd00:1::5]",
    		},
    	}
    
    	for i := range testCases {
    		got := AppendPortIfNeeded(testCases[i].addr, testCases[i].port)
    		if testCases[i].expect != got {
    			t.Errorf("case %s: expected %v, got %v", testCases[i].name, testCases[i].expect, got)
    		}
    	}
    }
    
    func TestMapIPsByIPFamily(t *testing.T) {
    	testCases := []struct {
    		desc            string
    		ipString        []string
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 20 11:57:43 UTC 2024
    - 17.1K bytes
    - Viewed (0)
  6. pilot/pkg/security/authz/matcher/string_test.go

    				},
    			},
    		},
    	}
    
    	for _, tc := range testCases {
    		t.Run(tc.name, func(t *testing.T) {
    			actual := StringMatcherWithPrefix(tc.v, tc.prefix)
    			if !cmp.Equal(actual, tc.want, protocmp.Transform()) {
    				t.Errorf("want %s but got %s", tc.want.String(), actual.String())
    			}
    		})
    	}
    }
    
    func TestStringMatcherRegex(t *testing.T) {
    	testCases := []testCase{
    		{
    			name: "wildcardAsRequired",
    			v:    "*",
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Aug 17 22:42:11 UTC 2023
    - 5.2K bytes
    - Viewed (0)
  7. internal/event/rules_test.go

    		{rulesCase8, NewPattern("", "*.jpg"), TargetID{"1", "webhook"}, 2},
    	}
    
    	for i, testCase := range testCases {
    		testCase.rules.Add(testCase.pattern, testCase.targetID)
    		result := len(testCase.rules)
    
    		if result != testCase.expectedResult {
    			t.Fatalf("test %v: result: expected: %v, got: %v", i+1, testCase.expectedResult, result)
    		}
    	}
    }
    
    func TestRulesMatch(t *testing.T) {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue Jun 01 21:59:40 UTC 2021
    - 8.8K bytes
    - Viewed (0)
  8. pkg/proxy/ipvs/ipset/ipset_test.go

    			},
    			valid: false,
    		},
    	}
    	for i := range testCases {
    		valid := testCases[i].entry.Validate(testCases[i].set)
    		if valid != testCases[i].valid {
    			t.Errorf("case [%d]: unexpected mismatch, expect valid[%v], got valid[%v], desc: %s", i, testCases[i].valid, valid, testCases[i].entry)
    		}
    	}
    }
    
    func TestEntryString(t *testing.T) {
    	testCases := []struct {
    		name   string
    		entry  *Entry
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Dec 19 01:20:51 UTC 2023
    - 41.5K bytes
    - Viewed (0)
  9. src/strings/replace_test.go

    	noHello := NewReplacer("Hello", "")
    	testCases = append(testCases,
    		testCase{noHello, "Hello", ""},
    		testCase{noHello, "Hellox", "x"},
    		testCase{noHello, "xHello", "x"},
    		testCase{noHello, "xHellox", "xx"},
    	)
    
    	// No-arg test cases.
    
    	nop := NewReplacer()
    	testCases = append(testCases,
    		testCase{nop, "abc", "abc"},
    		testCase{nop, "", ""},
    	)
    
    	// Run the test cases.
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 24 22:53:05 UTC 2017
    - 14.1K bytes
    - Viewed (0)
  10. internal/event/arn_test.go

    	for i, testCase := range testCases {
    		data, err := xml.Marshal(testCase.arn)
    		expectErr := (err != nil)
    
    		if expectErr != testCase.expectErr {
    			t.Fatalf("test %v: error: expected: %v, got: %v", i+1, testCase.expectErr, expectErr)
    		}
    
    		if !testCase.expectErr {
    			if !reflect.DeepEqual(data, testCase.expectedData) {
    				t.Fatalf("test %v: data: expected: %v, got: %v", i+1, string(testCase.expectedData), string(data))
    			}
    		}
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue Jun 01 21:59:40 UTC 2021
    - 3.8K bytes
    - Viewed (0)
Back to top