Öffentliche Dateiansicht: Raw-Dateien, Tree, Releases und Issues sind ohne Login verfügbar.
cmd/keys_test.go Raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
package cmd

import "testing"

func TestNormalizeKeyInput(t *testing.T) {
	tests := []struct {
		in   string
		want string
	}{
		{in: "db_password", want: "DB_PASSWORD"},
		{in: "  api.key  ", want: "API.KEY"},
		{in: "Mixed-Name", want: "MIXED-NAME"},
	}

	for _, tt := range tests {
		if got := normalizeKeyInput(tt.in); got != tt.want {
			t.Fatalf("normalizeKeyInput(%q) = %q, want %q", tt.in, got, tt.want)
		}
	}
}