diff --git a/ricochet_test.go b/ricochet_test.go index dcce6dc..1fa609e 100644 --- a/ricochet_test.go +++ b/ricochet_test.go @@ -52,3 +52,10 @@ func TestRicochetOpenWithError(t *testing.T) { t.Errorf("Open should have failed because of bad version negotiation.") } } + +func TestRicochetOpenWithNoServer(t *testing.T) { + _, err := Open("127.0.0.1:11002|abcdefghijklmno.onion") + if err == nil { + t.Errorf("Open should have failed because of bad version negotiation.") + } +} diff --git a/testing.md b/testing.md index db403eb..04c7b6f 100644 --- a/testing.md +++ b/testing.md @@ -10,7 +10,7 @@ links it to the automated test that exercises that functionality. File: [iricochet_test.go](./ricochet_test.go) -This stub test exercises the Open() function. `TestRicochetOpen`, `TestRicochetOpenWithError`. +This stub test exercises the Open() function. `TestRicochetOpen`, and in cases where the server returns a bad version, `TestRicochetOpenWithError`, and where there is no server at all `TestRicochetOpenWithNoServer` - in both cases Open should return an error. ## Inbound