Skip to content

Commit

Permalink
create test
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyredondo committed Sep 1, 2023
1 parent d00a450 commit 9e1aa5d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@

# Dependency directories (remove the comment below to include it)
# vendor/

.idea
11 changes: 11 additions & 0 deletions patcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"math/rand"
"reflect"
"testing"
"time"
)

//go:noinline
Expand Down Expand Up @@ -142,3 +143,13 @@ func TestInstanceValuePatcher(t *testing.T) {
t.Fatal("The unpatch did not work")
}
}

func TestRaceTest(t *testing.T) {
patch, _ := PatchMethod(
time.Now, func() time.Time {
loc, _ := time.LoadLocation("America/Sao_Paulo")
return time.Date(2000, 12, 15, 17, 8, 00, 0, loc)
})

defer patch.Unpatch()
}

0 comments on commit 9e1aa5d

Please sign in to comment.