(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func 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 | } |
nothing calls this directly
no test coverage detected