package flashpart_test import ( "encoding/hex" "testing" "git.cheetah.cat/cheetah/moto-flash-data/flashpart" "github.com/stretchr/testify/assert" ) func Test1(t *testing.T) { bytes, _ := hex.DecodeString("8032f60c2028140000000000000000006933342e3030302e3934323630202020") res := flashpart.ParseFlashPartHeader(bytes) assert.Equal(t, uint8(0x80), res.MediaID) assert.Equal(t, uint32(0x142820), res.TotalSize) assert.Equal(t, "i34.000.94260 ", res.VersionText) res.AdjustName("test") assert.Equal(t, "test ", res.VersionText) }