2020-01-06 14:22:46 +00:00
|
|
|
package capture
|
2019-07-17 15:01:53 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"testing"
|
|
|
|
"time"
|
2019-12-11 13:10:20 +00:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2019-07-17 15:01:53 +00:00
|
|
|
)
|
|
|
|
|
2020-01-06 14:22:46 +00:00
|
|
|
func TestTime(t *testing.T) {
|
2019-07-17 15:01:53 +00:00
|
|
|
start := time.Now()
|
|
|
|
time.Sleep(1 * time.Millisecond)
|
2020-01-12 13:25:58 +00:00
|
|
|
result := Time(start, fmt.Sprintf("%s", "Successful test"))
|
|
|
|
assert.Contains(t, result, "Successful test [")
|
2019-07-17 15:01:53 +00:00
|
|
|
}
|