github.com/projecteru2/core@v0.0.0-20240321043226-06bcc1c23f58/rpc/counter_test.go (about) 1 package rpc 2 3 import ( 4 "context" 5 "testing" 6 7 "github.com/stretchr/testify/assert" 8 ) 9 10 func TestCounter(t *testing.T) { 11 v := Vibranium{} 12 task := v.newTask(context.Background(), "test", true) 13 assert.Equal(t, v.TaskNum, 1) 14 15 task.done() 16 assert.Equal(t, v.TaskNum, 0) 17 18 v.Wait() 19 }