(t *testing.T)
| 84 | } |
| 85 | |
| 86 | func TestEncBuiltinMarshalBytes(t *testing.T) { |
| 87 | s := RunServerOnPort(TEST_PORT) |
| 88 | defer s.Shutdown() |
| 89 | |
| 90 | ec := NewDefaultEConn(t) |
| 91 | defer ec.Close() |
| 92 | ch := make(chan bool) |
| 93 | |
| 94 | testBytes := []byte("Hello World!") |
| 95 | |
| 96 | ec.Subscribe("enc_bytes", func(b []byte) { |
| 97 | if !bytes.Equal(b, testBytes) { |
| 98 | t.Fatalf("Received test bytes of '%s', wanted '%s'\n", b, testBytes) |
| 99 | } |
| 100 | ch <- true |
| 101 | }) |
| 102 | ec.Publish("enc_bytes", testBytes) |
| 103 | if e := Wait(ch); e != nil { |
| 104 | if ec.LastError() != nil { |
| 105 | e = ec.LastError() |
| 106 | } |
| 107 | t.Fatalf("Did not receive the message: %s", e) |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | func TestEncBuiltinMarshalInt(t *testing.T) { |
| 112 | s := RunServerOnPort(TEST_PORT) |
nothing calls this directly
no test coverage detected