github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/internal/runbits/mock/mock.go (about) 1 package mock 2 3 import ( 4 "time" 5 ) 6 7 // Incrementer implements a simple counter. This can be used to test functions that are expected to report its progress incrementally 8 type Incrementer struct { 9 Count int 10 } 11 12 // NewMockIncrementer fakes an integral progresser 13 func NewMockIncrementer() *Incrementer { 14 return &Incrementer{Count: 0} 15 } 16 17 // Increment increments the progress count by one 18 func (mi *Incrementer) Increment(_ ...time.Duration) { 19 mi.Count++ 20 }