github.com/nyan233/littlerpc@v0.4.6-0.20230316182519-0c8d5c48abaf/internal/reflect/convert_test.go (about)

     1  package reflect
     2  
     3  import (
     4  	"reflect"
     5  	"testing"
     6  )
     7  
     8  func TestConvert(t *testing.T) {
     9  	nTyp, _ := ToTypePtr(*new(int))
    10  	_ = nTyp.(*int)
    11  	efceT := interface{}(10)
    12  	val := ToValueTypeEface(reflect.ValueOf(efceT))
    13  	if val != efceT {
    14  		t.Fatal("efceT no equal value")
    15  	}
    16  }