Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for EqualErrors (0.12 sec)

  1. operator/pkg/util/errs.go

    	for i, e := range errors {
    		if e == nil {
    			continue
    		}
    		if i != 0 {
    			out += separator
    		}
    		out += e.Error()
    	}
    	return out
    }
    
    // EqualErrors reports whether a and b are equal, regardless of ordering.
    func EqualErrors(a, b Errors) bool {
    	if len(a) != len(b) {
    		return false
    	}
    	m := make(map[string]bool)
    	for _, e := range b {
    		m[e.Error()] = true
    	}
    	for _, ea := range a {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 29 20:42:01 UTC 2020
    - 3.1K bytes
    - Viewed (0)
  2. operator/pkg/validate/validate_values_test.go

    			if err != nil {
    				t.Fatalf("yaml.Unmarshal(%s): got error %s", tt.desc, err)
    			}
    			errs := CheckValues(util.MustStruct(root))
    			if gotErr, wantErr := errs, tt.wantErrs; !util.EqualErrors(gotErr, wantErr) {
    				t.Errorf("CheckValues(%s)(%v): gotErr:%s, wantErr:%s", tt.desc, tt.yamlStr, gotErr, wantErr)
    			}
    		})
    	}
    }
    
    func TestValidateValuesFromProfile(t *testing.T) {
    	tests := []struct {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 31 13:43:12 UTC 2024
    - 6K bytes
    - Viewed (0)
  3. operator/pkg/validate/validate_test.go

    			if err != nil {
    				t.Fatalf("unmarshalWithJSONPB(%s): got error %s", tt.desc, err)
    			}
    
    			errs := CheckIstioOperatorSpec(ispec, false)
    			if gotErrs, wantErrs := errs, tt.wantErrs; !util.EqualErrors(gotErrs, wantErrs) {
    				t.Errorf("ProtoToValues(%s)(%v): gotErrs:%s, wantErrs:%s", tt.desc, tt.yamlStr, gotErrs, wantErrs)
    			}
    		})
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sun Jun 25 11:44:31 UTC 2023
    - 4.6K bytes
    - Viewed (0)
  4. operator/pkg/controlplane/control_plane_test.go

    			},
    		},
    	}
    	for _, tt := range tests {
    		t.Run(tt.desc, func(t *testing.T) {
    			gotManifests, gotErrs := tt.testOperator.RenderManifest()
    			if !reflect.DeepEqual(gotManifests, tt.wantManifests) || !util.EqualErrors(gotErrs, tt.wantErrs) {
    				// reflect.DeepEqual returns false on size 0 maps
    				if !(len(gotManifests) == 0) && (len(tt.wantManifests) == 0) {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Apr 04 02:36:40 UTC 2023
    - 7.6K bytes
    - Viewed (0)
Back to top