utsname_uint8_test.go 441 B

12345678910111213141516
  1. // +build linux,arm linux,ppc64 linux,ppc64le s390x
  2. package platform
  3. import (
  4. "testing"
  5. "github.com/stretchr/testify/assert"
  6. )
  7. func TestTestCharToString(t *testing.T) {
  8. machineInBytes := [65]uint8{120, 56, 54, 95, 54, 52}
  9. machineInString := charsToString(machineInBytes)
  10. assert.NotNil(t, machineInString, "Unable to convert char into string.")
  11. assert.Equal(t, string("x86_64"), machineInString, "Parsed machine code not equal.")
  12. }