MCPcopy
hub / github.com/prometheus/client_golang / TestSequenceMatcherRatio

Function TestSequenceMatcherRatio

prometheus/internal/difflib_test.go:45–50  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

43}
44
45func TestSequenceMatcherRatio(t *testing.T) {
46 s := NewMatcher(splitChars("abcd"), splitChars("bcde"))
47 assertEqual(t, s.Ratio(), 0.75)
48 assertEqual(t, s.QuickRatio(), 0.75)
49 assertEqual(t, s.RealQuickRatio(), 1.0)
50}
51
52func TestGetOptCodes(t *testing.T) {
53 a := "qabxcd"

Callers

nothing calls this directly

Calls 6

NewMatcherFunction · 0.85
splitCharsFunction · 0.85
assertEqualFunction · 0.85
RatioMethod · 0.80
QuickRatioMethod · 0.80
RealQuickRatioMethod · 0.80

Tested by

no test coverage detected