Skip to content

Commit

Permalink
Merge pull request #7 from newmo-oss/fix-ctxtimetest-testname
Browse files Browse the repository at this point in the history
Fix test name
  • Loading branch information
tenntenn authored Jan 8, 2025
2 parents 3a98831 + 6fa93f9 commit fb24881
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ctxtimetest/ctxtimetest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
"github.com/newmo-oss/testid"
)

func TestWithFixedNow(t *testing.T) {
func TestSetFixedNow(t *testing.T) {
t.Parallel()

t.Run("before calling WithFixedNow", func(t *testing.T) {
t.Run("before calling SetFixedNow", func(t *testing.T) {
t.Parallel()

ctx := testid.WithValue(context.Background(), uuid.New().String())
Expand All @@ -27,7 +27,7 @@ func TestWithFixedNow(t *testing.T) {
}
})

t.Run("after calling WithFixedNow", func(t *testing.T) {
t.Run("after calling SetFixedNow", func(t *testing.T) {
t.Parallel()

ctx := testid.WithValue(context.Background(), uuid.New().String())
Expand All @@ -39,7 +39,7 @@ func TestWithFixedNow(t *testing.T) {
}
})

t.Run("after calling WithoutFixedNow", func(t *testing.T) {
t.Run("after calling UnsetFixedNow", func(t *testing.T) {
t.Parallel()

ctx := testid.WithValue(context.Background(), uuid.New().String())
Expand All @@ -48,7 +48,7 @@ func TestWithFixedNow(t *testing.T) {
ctxtimetest.UnsetFixedNow(t, ctx)
got := ctxtime.Now(ctx)
if now == got || now.After(got) {
t.Errorf("ctxtime.Now must return current time after calling WithoutFixedNow: %v %v", got, now)
t.Errorf("ctxtime.Now must return current time after calling UnsetFixedNow: %v %v", got, now)
}
})

Expand Down

0 comments on commit fb24881

Please sign in to comment.