github.com/andeya/ameda@v1.5.3/itoa_x_test.go (about)

     1  package ameda
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/assert"
     7  )
     8  
     9  func TestFormatUintByDict(t *testing.T) {
    10  	dict := []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
    11  	for i := uint64(0); i < 100; i++ {
    12  		numStr := FormatUintByDict(dict, i)
    13  		t.Logf("i=%d, s=%s", i, numStr)
    14  		i2, err := ParseUintByDict(dict, numStr)
    15  		assert.NoError(t, err)
    16  		assert.Equal(t, i, i2)
    17  	}
    18  }