2019-07-17 17:01:53 +02:00
|
|
|
package util
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"testing"
|
|
|
|
"time"
|
2019-12-11 14:10:20 +01:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2019-07-17 17:01:53 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestProfileTime(t *testing.T) {
|
|
|
|
start := time.Now()
|
|
|
|
time.Sleep(1 * time.Millisecond)
|
|
|
|
ProfileTime(start, fmt.Sprintf("%s", "Successful test"))
|
2019-12-03 13:21:41 +01:00
|
|
|
assert.Contains(t, logBuffer.String(), "Successful test [")
|
2019-07-17 17:01:53 +02:00
|
|
|
}
|