summaryrefslogtreecommitdiffstats
path: root/arch/arch_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arch_test.go')
-rw-r--r--arch/arch_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arch_test.go b/arch/arch_test.go
new file mode 100644
index 0000000..8913e41
--- /dev/null
+++ b/arch/arch_test.go
@@ -0,0 +1,19 @@
+// package arch contains mappings between the Golang architecture and
+// the RPM architecture used by Fedora CoreOS and derivatives.
+package arch
+
+import (
+ "runtime"
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+)
+
+func TestMapping(t *testing.T) {
+ // Validate bidirectional mapping for current architecture
+ assert.Equal(t, GoArch(CurrentRpmArch()), runtime.GOARCH)
+
+ assert.Equal(t, GoArch("x86_64"), "amd64")
+ assert.Equal(t, GoArch("aarch64"), "arm64")
+ assert.Equal(t, GoArch("ppc64le"), "ppc64le")
+}