MCPcopy
hub / github.com/nats-io/nats.go / TestEncBuiltinMarshalInt64

Function TestEncBuiltinMarshalInt64

test/enc_test.go:161–184  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

159}
160
161func TestEncBuiltinMarshalInt64(t *testing.T) {
162 s := RunServerOnPort(TEST_PORT)
163 defer s.Shutdown()
164
165 ec := NewDefaultEConn(t)
166 defer ec.Close()
167 ch := make(chan bool)
168
169 testN := 22
170
171 ec.Subscribe("enc_int", func(n int64) {
172 if n != int64(testN) {
173 t.Fatalf("Received test number of %d, wanted %d\n", n, testN)
174 }
175 ch <- true
176 })
177 ec.Publish("enc_int", testN)
178 if e := Wait(ch); e != nil {
179 if ec.LastError() != nil {
180 e = ec.LastError()
181 }
182 t.Fatalf("Did not receive the message: %s", e)
183 }
184}
185
186func TestEncBuiltinMarshalFloat32(t *testing.T) {
187 s := RunServerOnPort(TEST_PORT)

Callers

nothing calls this directly

Calls 8

NewDefaultEConnFunction · 0.85
FatalfMethod · 0.80
RunServerOnPortFunction · 0.70
WaitFunction · 0.70
SubscribeMethod · 0.65
PublishMethod · 0.65
CloseMethod · 0.45
LastErrorMethod · 0.45

Tested by

no test coverage detected