Commit 71e63fa4 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

all: use time.Time.Equal instead of == in some tests

(Found by making time.Time uncomparable and rerunning std tests
locally.)

Change-Id: I4fa6fb0ba7334965362387e2f6541c17a27ac3aa
Reviewed-on: https://go-review.googlesource.com/42616
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: default avatarMartin Möhrmann <moehrmann@google.com>
Reviewed-by: default avatarDamien Neil <dneil@google.com>
Reviewed-by: default avatarBryan Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent b8c7fddd
......@@ -3090,7 +3090,7 @@ func TestGoTestRaceInstallCgo(t *testing.T) {
tg.run("test", "-race", "-i", "runtime/race")
new, err := os.Stat(cgo)
tg.must(err)
if new.ModTime() != old.ModTime() {
if !new.ModTime().Equal(old.ModTime()) {
t.Fatalf("go test -i runtime/race reinstalled cmd/cgo")
}
}
......
......@@ -529,7 +529,7 @@ func TestDialerPartialDeadline(t *testing.T) {
if err != tt.expectErr {
t.Errorf("#%d: got %v; want %v", i, err, tt.expectErr)
}
if deadline != tt.expectDeadline {
if !deadline.Equal(tt.expectDeadline) {
t.Errorf("#%d: got %v; want %v", i, deadline, tt.expectDeadline)
}
}
......
......@@ -784,7 +784,7 @@ func TestRetryTimeout(t *testing.T) {
return nil, poll.ErrTimeout
}
if deadline == deadline0 {
if deadline.Equal(deadline0) {
t.Error("deadline didn't change")
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment