github.com/ahmet2mir/goreleaser@v0.180.3-0.20210927151101-8e5ee5a9b8c5/internal/linux/arch_test.go (about)

     1  package linux
     2  
     3  import (
     4  	"fmt"
     5  	"testing"
     6  
     7  	"github.com/stretchr/testify/require"
     8  )
     9  
    10  func TestArch(t *testing.T) {
    11  	for from, to := range map[string]string{
    12  		"linuxamd64":             "amd64",
    13  		"linux386":               "i386",
    14  		"linuxarm64":             "arm64",
    15  		"linuxarm5":              "armel",
    16  		"linuxarm6":              "armhf",
    17  		"linuxarm7":              "armhf",
    18  		"linuxppc64":             "ppc64",
    19  		"linuxppc64le":           "ppc64le",
    20  		"linuxwhat":              "what",
    21  		"linuxmips64lesoftfloat": "mips64el",
    22  		"linuxmipslehardfloat":   "mipsel",
    23  		"linuxmipssoftfloat":     "mips",
    24  		"linuxmips64hardfloat":   "mips64",
    25  	} {
    26  		t.Run(fmt.Sprintf("%s to %s", from, to), func(t *testing.T) {
    27  			require.Equal(t, to, Arch(from))
    28  		})
    29  	}
    30  }