aboutsummaryrefslogtreecommitdiff
path: root/src/net/dial_test.go
diff options
context:
space:
mode:
authorludweeg <mursalimovemeel@gmail.com>2018-10-06 18:38:37 +0300
committerMikio Hara <mikioh.mikioh@gmail.com>2018-10-07 02:36:02 +0000
commit165ebaf97bc4c4863a756775d75ddc750c55b8f2 (patch)
tree2d3cad9cda483d7e7e01696b1fd05afe58b262e5 /src/net/dial_test.go
parent2bb91e093cb57c5ba5ca71f0d0a63913a07f21f4 (diff)
downloadgo-165ebaf97bc4c4863a756775d75ddc750c55b8f2.tar.gz
go-165ebaf97bc4c4863a756775d75ddc750c55b8f2.zip
net: simplify bool expression
Simplify `!(x <= y)` to `x > y` and `!(x >= y)` to `x < y` where x,y are not defined as float. Change-Id: Id1e5b518395d97e75f96aa4ac5d6c0ee990c0e7d Reviewed-on: https://go-review.googlesource.com/c/140337 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Diffstat (limited to 'src/net/dial_test.go')
-rw-r--r--src/net/dial_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/net/dial_test.go b/src/net/dial_test.go
index 00a84d17d6..3a45c0d2ec 100644
--- a/src/net/dial_test.go
+++ b/src/net/dial_test.go
@@ -318,9 +318,9 @@ func TestDialParallel(t *testing.T) {
expectElapsedMin := tt.expectElapsed - 95*time.Millisecond
expectElapsedMax := tt.expectElapsed + 95*time.Millisecond
- if !(elapsed >= expectElapsedMin) {
+ if elapsed < expectElapsedMin {
t.Errorf("#%d: got %v; want >= %v", i, elapsed, expectElapsedMin)
- } else if !(elapsed <= expectElapsedMax) {
+ } else if elapsed > expectElapsedMax {
t.Errorf("#%d: got %v; want <= %v", i, elapsed, expectElapsedMax)
}
@@ -418,10 +418,10 @@ func TestDialerFallbackDelay(t *testing.T) {
}
expectMin := tt.expectElapsed - 1*time.Millisecond
expectMax := tt.expectElapsed + 95*time.Millisecond
- if !(elapsed >= expectMin) {
+ if elapsed < expectMin {
t.Errorf("#%d: got %v; want >= %v", i, elapsed, expectMin)
}
- if !(elapsed <= expectMax) {
+ if elapsed > expectMax {
t.Errorf("#%d: got %v; want <= %v", i, elapsed, expectMax)
}
}