MCPcopy Create free account
hub / github.com/evcc-io/evcc / TestProgress

Function TestProgress

core/progress_test.go:10–33  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestProgress(t *testing.T) {
11 p := NewProgress(0, 10)
12
13 tc := []struct {
14 value float64
15 res bool
16 }{
17 {-1, false},
18 {0, true},
19 {1, false},
20 {5, false},
21 {10, true},
22 {15, false},
23 {25, true},
24 {30, true},
25 {60, true},
26 {65, false},
27 {70, true},
28 }
29
30 for _, tc := range tc {
31 require.Equal(t, tc.res, p.NextStep(tc.value), fmt.Sprintf("%.0f%%", tc.value))
32 }
33}

Callers

nothing calls this directly

Calls 2

NextStepMethod · 0.95
NewProgressFunction · 0.85

Tested by

no test coverage detected