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

Function TestWithAsciiOnDelete

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

Source from the content-addressed store, hash-verified

168}
169
170func TestWithAsciiOnDelete(t *testing.T) {
171 sm := NewMatcher(splitChars(rep("a", 40)+"c"+rep("b", 40)),
172 splitChars(rep("a", 40)+rep("b", 40)))
173 assertAlmostEqual(t, sm.Ratio(), 0.994, 3)
174 assertEqual(t, sm.GetOpCodes(),
175 []OpCode{{'e', 0, 40, 0, 40}, {'d', 40, 41, 40, 40}, {'e', 41, 81, 40, 80}})
176}
177
178func TestWithAsciiBJunk(t *testing.T) {
179 isJunk := func(s string) bool {

Callers

nothing calls this directly

Calls 7

NewMatcherFunction · 0.85
splitCharsFunction · 0.85
repFunction · 0.85
assertAlmostEqualFunction · 0.85
assertEqualFunction · 0.85
RatioMethod · 0.80
GetOpCodesMethod · 0.80

Tested by

no test coverage detected