MCPcopy
hub / github.com/google/go-cmp / Similar

Method Similar

cmp/internal/diff/diff.go:117–120  ·  view source on GitHub ↗

Similar indicates whether two symbols are similar and may be represented by using the Modified type. As a special case, we consider binary comparisons (i.e., those that return Result{1, 0} or Result{0, 1}) to be similar. The exact ratio of NumSame to NumDiff to determine similarity may change.

()

Source from the content-addressed store, hash-verified

115//
116// The exact ratio of NumSame to NumDiff to determine similarity may change.
117func (r Result) Similar() bool {
118 // Use NumSame+1 to offset NumSame so that binary comparisons are similar.
119 return r.NumSame+1 >= r.NumDiff
120}
121
122var randBool = rand.New(rand.NewSource(time.Now().Unix())).Intn(2) == 0
123

Callers 4

BeginMethod · 0.80
connectMethod · 0.80
validateScriptFunction · 0.80
TestResultFunction · 0.80

Calls

no outgoing calls

Tested by 2

validateScriptFunction · 0.64
TestResultFunction · 0.64