MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / TestNewPartialRanges1

Function TestNewPartialRanges1

internal/caches/partial_ranges_test.go:30–48  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28}
29
30func TestNewPartialRanges1(t *testing.T) {
31 var a = assert.NewAssertion(t)
32
33 var r = caches.NewPartialRanges(0)
34 r.Add(1, 100)
35 r.Add(1, 101)
36 r.Add(1, 102)
37 r.Add(2, 103)
38 r.Add(200, 300)
39 r.Add(1, 1000)
40
41 var rs = r.Ranges
42 logs.PrintAsJSON(rs, t)
43 a.IsTrue(len(rs) == 1)
44 if len(rs) == 1 {
45 a.IsTrue(rs[0][0] == 1)
46 a.IsTrue(rs[0][1] == 1000)
47 }
48}
49
50func TestNewPartialRanges2(t *testing.T) {
51 // low -> high

Callers

nothing calls this directly

Calls 2

NewPartialRangesFunction · 0.92
AddMethod · 0.65

Tested by

no test coverage detected