Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 1,130 for testCases (0.13 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. 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)
  4. 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)
  5. 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)
  6. 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)
  7. internal/event/rulesmap_test.go

    		{rulesMapCase4, ObjectCreatedPut, "2000/photo.png", NewTargetIDSet(TargetID{"2", "amqp"})},
    	}
    
    	for i, testCase := range testCases {
    		result := testCase.rulesMap.Match(testCase.eventName, testCase.objectName)
    
    		if !reflect.DeepEqual(result, testCase.expectedResult) {
    			t.Fatalf("test %v: result: expected: %v, got: %v", i+1, testCase.expectedResult, result)
    		}
    	}
    }
    
    func TestNewRulesMap(t *testing.T) {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Jan 05 18:43:06 UTC 2024
    - 6.8K bytes
    - Viewed (0)
  8. internal/config/lambda/event/targetid_test.go

    	for i, testCase := range testCases {
    		targetID := &TargetID{}
    		err := targetID.UnmarshalJSON(testCase.data)
    		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 *targetID != *testCase.expectedTargetID {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue Mar 07 16:12:41 UTC 2023
    - 3.5K bytes
    - Viewed (0)
  9. cmd/storage-rest_test.go

    	}
    
    	result := make([]byte, 100)
    	for i, testCase := range testCases {
    		result = result[testCase.offset:3]
    		_, err := storage.ReadFile(context.Background(), testCase.volumeName, testCase.objectName, testCase.offset, result, nil)
    		expectErr := (err != nil)
    
    		if expectErr != testCase.expectErr {
    			t.Fatalf("case %v: error: expected: %v, got: %v", i+1, testCase.expectErr, expectErr)
    		}
    
    		if !testCase.expectErr {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 11.4K bytes
    - Viewed (0)
  10. internal/auth/credentials_test.go

    		{1574812326.000, false},
    		{time.Duration(3) * time.Minute, false},
    	}
    
    	for _, testCase := range testCases {
    		testCase := testCase
    		t.Run("", func(t *testing.T) {
    			_, err := ExpToInt64(testCase.exp)
    			if err != nil && !testCase.expectedFailure {
    				t.Errorf("Expected success but got failure %s", err)
    			}
    			if err == nil && testCase.expectedFailure {
    				t.Error("Expected failure but got success")
    			}
    		})
    	}
    }
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Mar 01 21:09:42 UTC 2024
    - 5.4K bytes
    - Viewed (0)
Back to top