Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 579 for testCases (0.14 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. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. cmd/utils_test.go

    		},
    	}
    
    	// Validate all test cases.
    	for _, testCase := range testCases {
    		testCase := testCase
    		t.Run("", func(t *testing.T) {
    			bucketName, objectName := path2BucketObject(testCase.path)
    			if bucketName != testCase.bucket {
    				t.Errorf("failed expected bucket name \"%s\", got \"%s\"", testCase.bucket, bucketName)
    			}
    			if objectName != testCase.object {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Feb 23 21:28:14 UTC 2024
    - 10.2K bytes
    - Viewed (0)
  8. pkg/kubelet/cm/cpumanager/policy_options_test.go

    			expectedAvailable: false,
    		},
    	}
    	for _, testCase := range testCases {
    		t.Run(testCase.option, func(t *testing.T) {
    			featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, testCase.featureGate, testCase.featureGateEnable)
    			err := CheckPolicyOptionAvailable(testCase.option)
    			isEnabled := (err == nil)
    			if isEnabled != testCase.expectedAvailable {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  9. cmd/auth-handler_test.go

    	}
    
    	// Validates all testcases.
    	for i, testCase := range testCases {
    		s3Error := isReqAuthenticated(ctx, testCase.req, globalSite.Region(), serviceS3)
    		if s3Error != testCase.s3Error {
    			if _, err := io.ReadAll(testCase.req.Body); toAPIErrorCode(ctx, err) != testCase.s3Error {
    				t.Fatalf("Test %d: Unexpected S3 error: want %d - got %d (got after reading request %s)", i, testCase.s3Error, s3Error, toAPIError(ctx, err).Code)
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 15.4K bytes
    - Viewed (0)
  10. cmd/update_test.go

    		},
    	}
    	for i, testCase := range testCases {
    		if testCase.errStr != "" {
    			got := releaseTimeToReleaseTag(testCase.t)
    			if got != testCase.tag && testCase.errStr == "" {
    				t.Errorf("Test %d: Expected %v but got %v", i+1, testCase.tag, got)
    			}
    		}
    		tagTime, err := releaseTagToReleaseTime(testCase.tag)
    		if err != nil && err.Error() != testCase.errStr {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Sat Mar 09 03:07:08 UTC 2024
    - 10.7K bytes
    - Viewed (0)
Back to top