aboutsummaryrefslogtreecommitdiff
path: root/src/testing/synctest/synctest_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/synctest/synctest_test.go')
-rw-r--r--src/testing/synctest/synctest_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/testing/synctest/synctest_test.go b/src/testing/synctest/synctest_test.go
index 9c73178750..62f10d1b81 100644
--- a/src/testing/synctest/synctest_test.go
+++ b/src/testing/synctest/synctest_test.go
@@ -11,6 +11,7 @@ import (
"regexp"
"testing"
"testing/synctest"
+ "time"
)
// Tests for interactions between synctest bubbles and the testing package.
@@ -179,3 +180,11 @@ func runTest(t *testing.T, args []string, f func(), pattern string) {
t.Errorf("got output:\n%s\nwant matching:\n%s", out, pattern)
}
}
+
+func TestNow(t *testing.T) {
+ synctest.Test(t, func(t *testing.T) {
+ if got, want := time.Now(), time.Date(2000, time.January, 1, 0, 0, 0, 0, time.UTC); !got.Equal(want) {
+ t.Errorf("time.Now() = %v, want %v", got, want)
+ }
+ })
+}