Skip to content

Commit

Permalink
fix: fix test bug
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkgos committed Apr 26, 2024
1 parent b327149 commit ecb6582
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding

http encoding toolkit

[![GoDoc](https://godoc.org/github.com/things-go/encoding?status.svg)](https://godoc.org/github.com/things-go/encoding)
Expand Down
11 changes: 6 additions & 5 deletions encoding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/things-go/encoding/form"
"github.com/things-go/encoding/json"
"github.com/things-go/encoding/msgpack"
pro "github.com/things-go/encoding/proto"
"github.com/things-go/encoding/testdata/examplepb"
"github.com/things-go/encoding/toml"
"github.com/things-go/encoding/xml"
Expand All @@ -45,14 +46,14 @@ func Test_Encoding_Register(t *testing.T) {
t.Run("remove MIME type", func(t *testing.T) {
registry := New()

got := registry.Get(MIMEMSGPACK2)
_, ok := got.(*msgpack.Codec)
require.True(t, ok, "should be got MIME wildcard marshaler")
got := registry.Get(MIMEPROTOBUF)
_, ok := got.(*pro.Codec)
require.True(t, ok, "should be got MIME proto marshaler")

err := registry.Delete(MIMEMSGPACK2)
err := registry.Delete(MIMEPROTOBUF)
require.NoError(t, err)

got = registry.Get(MIMEMSGPACK2)
got = registry.Get(MIMEPROTOBUF)
_, ok = got.(*HTTPBodyCodec)
require.True(t, ok, "should be got MIME wildcard marshaler")
})
Expand Down

0 comments on commit ecb6582

Please sign in to comment.