aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/net/net_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/net/net_test.go')
-rw-r--r--libgo/go/net/net_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/libgo/go/net/net_test.go b/libgo/go/net/net_test.go
index 409e140..6e7be4d 100644
--- a/libgo/go/net/net_test.go
+++ b/libgo/go/net/net_test.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build !js
// +build !js
package net
@@ -587,3 +588,23 @@ func TestNotTemporaryRead(t *testing.T) {
}
withTCPConnPair(t, client, server)
}
+
+// The various errors should implement the Error interface.
+func TestErrors(t *testing.T) {
+ var (
+ _ Error = &OpError{}
+ _ Error = &ParseError{}
+ _ Error = &AddrError{}
+ _ Error = UnknownNetworkError("")
+ _ Error = InvalidAddrError("")
+ _ Error = &timeoutError{}
+ _ Error = &DNSConfigError{}
+ _ Error = &DNSError{}
+ )
+
+ // ErrClosed was introduced as type error, so we can't check
+ // it using a declaration.
+ if _, ok := ErrClosed.(Error); !ok {
+ t.Fatal("ErrClosed does not implement Error")
+ }
+}