Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 57 for testSave (0.16 sec)

  1. internal/event/rulesmap_test.go

    		{rulesMapCase3, rulesMapToAddCase3, expectedResultCase3},
    	}
    
    	for i, testCase := range testCases {
    		testCase.rulesMap.Add(testCase.rulesMapToAdd)
    
    		if !reflect.DeepEqual(testCase.rulesMap, testCase.expectedResult) {
    			t.Fatalf("test %v: result: expected: %v, got: %v", i+1, testCase.expectedResult, testCase.rulesMap)
    		}
    	}
    }
    
    func TestRulesMapRemove(t *testing.T) {
    	rulesMapCase1 := make(RulesMap)
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Jan 05 18:43:06 GMT 2024
    - 6.8K bytes
    - Viewed (0)
  2. internal/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 {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue Jun 01 21:59:40 GMT 2021
    - 3.5K bytes
    - Viewed (0)
  3. internal/config/bool-flag_test.go

    		{[]byte(`"OFF"`), BoolFlag(false), false},
    	}
    
    	for _, testCase := range testCases {
    		var flag BoolFlag
    		err := (&flag).UnmarshalJSON(testCase.data)
    		if !testCase.expectedErr && err != nil {
    			t.Fatalf("error: expected = <nil>, got = %v", err)
    		}
    		if testCase.expectedErr && err == nil {
    			t.Fatalf("error: expected error, got = <nil>")
    		}
    		if err == nil && testCase.expectedResult != flag {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue Jun 01 21:59:40 GMT 2021
    - 3.5K bytes
    - Viewed (0)
  4. internal/amztime/parse_test.go

    		},
    	}
    
    	for _, testCase := range testCases {
    		testCase := testCase
    		t.Run(testCase.timeStr, func(t *testing.T) {
    			gott, goterr := Parse(testCase.timeStr)
    			if !errors.Is(goterr, testCase.expectedErr) {
    				t.Errorf("expected %v, got %v", testCase.expectedErr, goterr)
    			}
    			if !gott.Equal(testCase.expectedTime) {
    				t.Errorf("expected %v, got %v", testCase.expectedTime, gott)
    			}
    		})
    	}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed Sep 07 14:24:54 GMT 2022
    - 1.6K bytes
    - Viewed (0)
  5. cmd/erasure-server-pool-decom_test.go

    		},
    	}
    
    	t.Parallel()
    	for _, testCase := range testCases {
    		testCase := testCase
    		t.Run(testCase.name, func(t *testing.T) {
    			update, err := testCase.meta.validate(testCase.pools)
    			if testCase.expectedErr {
    				t.Log(err)
    			}
    			if err != nil && !testCase.expectedErr {
    				t.Errorf("Expected success, but found %s", err)
    			}
    			if err == nil && testCase.expectedErr {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Jul 03 16:47:40 GMT 2023
    - 4.8K bytes
    - Viewed (0)
  6. cmd/server-main_test.go

    			config:      "testdata/config/invalid-disks.yaml",
    			expectedErr: true,
    		},
    	} {
    		testcase := testcase
    		t.Run(testcase.config, func(t *testing.T) {
    			sctx := &serverCtxt{}
    			err := mergeServerCtxtFromConfigFile(testcase.config, sctx)
    			if testcase.expectedErr && err == nil {
    				t.Error("expected failure, got success")
    			}
    			if !testcase.expectedErr && err != nil {
    				t.Error("expected success, got failure", err)
    			}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Dec 07 09:33:56 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  7. internal/config/identity/openid/jwt_test.go

    	}
    
    	for _, testCase := range testCases {
    		testCase := testCase
    		t.Run("", func(t *testing.T) {
    			claims := map[string]interface{}{}
    			claims["exp"] = testCase.exp
    			err := updateClaimsExpiry(testCase.dsecs, claims)
    			if err != nil && !testCase.expectedFailure {
    				t.Errorf("Expected success, got failure %s", err)
    			}
    			if err == nil && testCase.expectedFailure {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 8.3K bytes
    - Viewed (0)
  8. cmd/handler-utils_test.go

    		{malformedReq, globalMinioDefaultRegion, ErrMalformedXML},
    	}
    
    	for i, testCase := range testCases {
    		config.SetRegion(globalServerConfig, testCase.serverConfigRegion)
    		_, actualCode := parseLocationConstraint(testCase.request)
    		if testCase.expectedCode != actualCode {
    			t.Errorf("Test %d: Expected the APIErrCode to be %d, but instead found %d", i+1, testCase.expectedCode, actualCode)
    		}
    	}
    }
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 6.1K bytes
    - Viewed (0)
  9. cmd/api-errors_test.go

    }
    
    func TestAPIErrCode(t *testing.T) {
    	ctx := context.Background()
    	for i, testCase := range toAPIErrorTests {
    		errCode := toAPIErrorCode(ctx, testCase.err)
    		if errCode != testCase.errCode {
    			t.Errorf("Test %d: Expected error code %d, got %d", i+1, testCase.errCode, errCode)
    		}
    	}
    }
    
    // Check if an API error is properly defined
    func TestAPIErrCodeDefinition(t *testing.T) {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Sep 25 15:13:08 GMT 2023
    - 3.4K bytes
    - Viewed (0)
  10. 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))
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed May 01 01:11:10 GMT 2024
    - 7.4K bytes
    - Viewed (0)
Back to top