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

Function TestEncBuiltinDecodeDefault

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

Source from the content-addressed store, hash-verified

451}
452
453func TestEncBuiltinDecodeDefault(t *testing.T) {
454 de := &builtin.DefaultEncoder{}
455 b, err := de.Encode("foo", 22)
456 if err != nil {
457 t.Fatalf("Expected no error encoding number: %v", err)
458 }
459 var c chan bool
460 err = de.Decode("foo", b, &c)
461 if err == nil {
462 t.Fatalf("Expected an error decoding")
463 }
464}
465
466func TestEncDrainSupported(t *testing.T) {
467 s := RunServerOnPort(TEST_PORT)

Callers

nothing calls this directly

Calls 3

EncodeMethod · 0.95
DecodeMethod · 0.95
FatalfMethod · 0.80

Tested by

no test coverage detected