(t *testing.T)
| 270 | } |
| 271 | |
| 272 | func TestEncBuiltinExtendedSubscribeCB(t *testing.T) { |
| 273 | s := RunServerOnPort(TEST_PORT) |
| 274 | defer s.Shutdown() |
| 275 | |
| 276 | ec := NewDefaultEConn(t) |
| 277 | defer ec.Close() |
| 278 | |
| 279 | ch := make(chan bool) |
| 280 | |
| 281 | testString := "Hello World!" |
| 282 | subject := "cb_args" |
| 283 | |
| 284 | ec.Subscribe(subject, func(subj, s string) { |
| 285 | if s != testString { |
| 286 | t.Fatalf("Received test string of '%s', wanted '%s'\n", s, testString) |
| 287 | } |
| 288 | if subj != subject { |
| 289 | t.Fatalf("Received subject of '%s', wanted '%s'\n", subj, subject) |
| 290 | } |
| 291 | ch <- true |
| 292 | }) |
| 293 | ec.Publish(subject, testString) |
| 294 | if e := Wait(ch); e != nil { |
| 295 | if ec.LastError() != nil { |
| 296 | e = ec.LastError() |
| 297 | } |
| 298 | t.Fatalf("Did not receive the message: %s", e) |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | func TestEncBuiltinExtendedSubscribeCB2(t *testing.T) { |
| 303 | s := RunServerOnPort(TEST_PORT) |
nothing calls this directly
no test coverage detected