github.com/v2pro/plz@v0.0.0-20221028024117-e5f9aec5b631/msgfmt/jsonfmt/level_0/unsupported_test.go (about)

     1  package test
     2  
     3  import (
     4  	"testing"
     5  	"github.com/v2pro/plz/msgfmt/jsonfmt"
     6  	"github.com/stretchr/testify/require"
     7  	"github.com/v2pro/plz/reflect2"
     8  )
     9  
    10  func Test_unsupported(t *testing.T) {
    11  	should := require.New(t)
    12  	encoder := jsonfmt.EncoderOf(reflect2.TypeOf(make(chan int, 10)))
    13  	output := encoder.Encode(nil,nil, reflect2.PtrOf(make(chan int, 10)))
    14  	should.Equal(`"can not encode chan int  to json"`, string(output))
    15  }