MCPcopy
hub / github.com/gin-gonic/gin / TestBindingBSON

Function TestBindingBSON

binding/binding_test.go:738–748  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

736}
737
738func TestBindingBSON(t *testing.T) {
739 var obj FooStruct
740 obj.Foo = "bar"
741 data, _ := bson.Marshal(&obj)
742 testBodyBinding(t,
743 BSON, "bson",
744 "/", "/",
745 string(data),
746 // note: for badbody, we remove first byte to make it invalid
747 string(data[1:]))
748}
749
750func TestValidationFails(t *testing.T) {
751 var obj FooStruct

Callers

nothing calls this directly

Calls 2

testBodyBindingFunction · 0.85
MarshalMethod · 0.65

Tested by

no test coverage detected