package config

import (
	"testing"
)

func Test_replace(t *testing.T) {
	t.Parallel()
	data := []struct {
		title        string
		key          string
		replacements map[string]string
		exp          string
	}{
		{
			title: "replace",
			key:   osDarwin,
			exp:   "x86_64",
			replacements: map[string]string{
				osDarwin: "x86_64",
			},
		},
		{
			title:        "not replace",
			key:          osDarwin,
			exp:          osDarwin,
			replacements: map[string]string{},
		},
	}
	for _, d := range data {
		t.Run(d.title, func(t *testing.T) {
			t.Parallel()
			val := replace(d.key, d.replacements)
			if val != d.exp {
				t.Fatalf("wanted %s, got %s", d.exp, val)
			}
		})
	}
}
