-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add test.gno feat: TestSkipTimestamps now takes time.Duration feat: use time instead of std.GetTimestamp
- Loading branch information
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package mtimestamp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package mtimestamp | ||
|
||
import ( | ||
"time" | ||
"std" | ||
"testing" | ||
) | ||
|
||
|
||
func TestSkipDuration(t *testing.T) { | ||
// Duration 3hr 2min 1sec | ||
myDur := time.Second * 1 | ||
myDur += time.Minute * 2 | ||
myDur += time.Hour * 3 | ||
|
||
start := time.Now() | ||
std.TestSkipTimestamps(myDur) | ||
end := time.Now() | ||
|
||
if end.Sub(start) != myDur { | ||
t.Errorf("time diff between start and end should be equal to myDur %v), but got %v", myDur, end.Sub(start)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters