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

     1  package ameda
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/assert"
     7  )
     8  
     9  func TestParseUintByDict(t *testing.T) {
    10  	dict := []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
    11  	numStr := "DDEZQ"
    12  	num, err := ParseUintByDict(dict, numStr)
    13  	assert.NoError(t, err)
    14  	t.Logf("DDEZQ=%d", num) // DDEZQ=1427026
    15  	numStr2 := FormatUintByDict(dict, num)
    16  	assert.Equal(t, numStr2, numStr)
    17  }