libstdc++: Workaround glibc headers on ia64-linux
[official-gcc.git] / libgo / go / context / net_test.go
bloba007689d363713a4c548623ef934c6bb83918ade
1 // Copyright 2016 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 package context_test
7 import (
8 "context"
9 "net"
10 "testing"
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")
18 if !err.Timeout() || !err.Temporary() {
19 t.Fatalf("Timeout() = %v, Temporary() = %v, want true, true", err.Timeout(), err.Temporary())