(t *testing.T)
| 38 | } |
| 39 | |
| 40 | func TestEncBuiltinConstructorErrs(t *testing.T) { |
| 41 | s := RunServerOnPort(TEST_PORT) |
| 42 | defer s.Shutdown() |
| 43 | |
| 44 | c := NewConnection(t, TEST_PORT) |
| 45 | _, err := nats.NewEncodedConn(nil, "default") |
| 46 | if err == nil { |
| 47 | t.Fatal("Expected err for nil connection") |
| 48 | } |
| 49 | _, err = nats.NewEncodedConn(c, "foo22") |
| 50 | if err == nil { |
| 51 | t.Fatal("Expected err for bad encoder") |
| 52 | } |
| 53 | c.Close() |
| 54 | _, err = nats.NewEncodedConn(c, "default") |
| 55 | if err == nil { |
| 56 | t.Fatal("Expected err for closed connection") |
| 57 | } |
| 58 | |
| 59 | } |
| 60 | |
| 61 | func TestEncBuiltinMarshalString(t *testing.T) { |
| 62 | s := RunServerOnPort(TEST_PORT) |
nothing calls this directly
no test coverage detected