MCPcopy
hub / github.com/grpc/grpc-go / testEqual

Function testEqual

balancer/rls/config_test.go:37–48  ·  view source on GitHub ↗

testEqual reports whether the lbCfgs a and b are equal. This is to be used only from tests. This ignores the keyBuilderMap field because its internals are not exported, and hence not possible to specify in the want section of the test. This is fine because we already have tests to make sure that the

(a, b *lbConfig)

Source from the content-addressed store, hash-verified

35// the test. This is fine because we already have tests to make sure that the
36// keyBuilder is parsed properly from the service config.
37func testEqual(a, b *lbConfig) bool {
38 return a.lookupService == b.lookupService &&
39 a.lookupServiceTimeout == b.lookupServiceTimeout &&
40 a.maxAge == b.maxAge &&
41 a.staleAge == b.staleAge &&
42 a.cacheSizeBytes == b.cacheSizeBytes &&
43 a.defaultTarget == b.defaultTarget &&
44 a.controlChannelServiceConfig == b.controlChannelServiceConfig &&
45 a.childPolicyName == b.childPolicyName &&
46 a.childPolicyTargetField == b.childPolicyTargetField &&
47 childPolicyConfigEqual(a.childPolicyConfig, b.childPolicyConfig)
48}
49
50// TestParseConfig verifies successful config parsing scenarios.
51func (s) TestParseConfig(t *testing.T) {

Callers 1

TestParseConfigMethod · 0.85

Calls 1

childPolicyConfigEqualFunction · 0.85

Tested by

no test coverage detected