aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/context/context_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/context/context_test.go')
-rw-r--r--libgo/go/context/context_test.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/libgo/go/context/context_test.go b/libgo/go/context/context_test.go
index 548476f..96ad146 100644
--- a/libgo/go/context/context_test.go
+++ b/libgo/go/context/context_test.go
@@ -5,8 +5,10 @@
package context
import (
+ "errors"
"fmt"
"math/rand"
+ "os"
"runtime"
"strings"
"sync"
@@ -94,7 +96,7 @@ func XTestWithCancel(t testingT) {
}
cancel()
- time.Sleep(100 * time.Millisecond) // let cancelation propagate
+ time.Sleep(100 * time.Millisecond) // let cancellation propagate
for i, c := range contexts {
select {
@@ -306,7 +308,7 @@ func XTestCanceledTimeout(t testingT) {
o := otherContext{c}
c, cancel := WithTimeout(o, 2*time.Second)
cancel()
- time.Sleep(100 * time.Millisecond) // let cancelation propagate
+ time.Sleep(100 * time.Millisecond) // let cancellation propagate
select {
case <-c.Done():
default:
@@ -343,7 +345,7 @@ func XTestValues(t testingT) {
c1 := WithValue(Background(), k1, "c1k1")
check(c1, "c1", "c1k1", "", "")
- if got, want := fmt.Sprint(c1), `context.Background.WithValue(1, "c1k1")`; got != want {
+ if got, want := fmt.Sprint(c1), `context.Background.WithValue(type context.key1, val c1k1)`; got != want {
t.Errorf("c.String() = %q want %q", got, want)
}
@@ -647,4 +649,7 @@ func XTestDeadlineExceededSupportsTimeout(t testingT) {
if !i.Timeout() {
t.Fatal("wrong value for timeout")
}
+ if !errors.Is(DeadlineExceeded, os.ErrTimeout) {
+ t.Fatal("errors.Is(DeadlineExceeded, os.ErrTimeout) = false, want true")
+ }
}