codekingpro/portable-devtools
114k
1// Copyright 2016 The Go Authors. All rights reserved.2// Use of this source code is governed by a BSD-style3// license that can be found in the LICENSE file.4 5package context_test6 7import (8 "context"9 "net"10 "testing"11)12 13func 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 