mirror of
https://github.com/fatedier/frp.git
synced 2026-01-11 22:23:12 +00:00
rename models to pkg (#2005)
This commit is contained in:
23
pkg/util/metric/counter_test.go
Normal file
23
pkg/util/metric/counter_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package metric
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestCounter(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
c := NewCounter()
|
||||
c.Inc(10)
|
||||
assert.EqualValues(10, c.Count())
|
||||
|
||||
c.Dec(5)
|
||||
assert.EqualValues(5, c.Count())
|
||||
|
||||
cTmp := c.Snapshot()
|
||||
assert.EqualValues(5, cTmp.Count())
|
||||
|
||||
c.Clear()
|
||||
assert.EqualValues(0, c.Count())
|
||||
}
|
||||
Reference in New Issue
Block a user