...
Source file
src/context/net_test.go
Documentation: context
1
2
3
4
5 package context_test
6
7 import (
8 "context"
9 "net"
10 "testing"
11 )
12
13 func TestDeadlineExceededIsNetError(t *testing.T) {
14 err, ok := context.DeadlineExceeded.(net.Error)
15 if !ok {
16 t.Fatal("DeadlineExceeded does not implement net.Error")
17 }
18 if !err.Timeout() || !err.Temporary() {
19 t.Fatalf("Timeout() = %v, Temporary() = %v, want true, true", err.Timeout(), err.Temporary())
20 }
21 }
22
View as plain text