add more tests for prof (#322)

This commit is contained in:
Kevin Wan
2020-12-27 14:45:14 +08:00
committed by GitHub
parent 8df7de94e3
commit 71a2b20301
2 changed files with 39 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
package prof
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestReport(t *testing.T) {
once.Do(func() {})
assert.NotContains(t, generateReport(), "foo")
report("foo", time.Second)
assert.Contains(t, generateReport(), "foo")
report("foo", time.Second)
}