github.com/v2pro/plz@v0.0.0-20221028024117-e5f9aec5b631/dump/test/level_0_test.go (about)

     1  package test
     2  
     3  import (
     4  	"testing"
     5  	"github.com/v2pro/plz/test"
     6  	"github.com/v2pro/plz/countlog"
     7  	"github.com/v2pro/plz/dump"
     8  	"github.com/v2pro/plz/test/must"
     9  )
    10  
    11  func Test_level0(t *testing.T) {
    12  	t.Run("int8", test.Case(func(ctx *countlog.Context) {
    13  		must.JsonEqual(`{
    14  		"__root__": {
    15  			"type": "int8",
    16  			"data": {
    17  				"__ptr__": "{ptr1}"
    18  			}
    19  		},
    20  		"{ptr1}": 100}`, dump.Var{int8(100)}.String())
    21  	}))
    22  }