26 lines
577 B
Go
26 lines
577 B
Go
package actions
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestFormatInputEnvKey(t *testing.T) {
|
|
cases := []struct {
|
|
input string
|
|
expected string
|
|
}{
|
|
{input: "test", expected: "INPUT_TEST"},
|
|
{input: "test-test", expected: "INPUT_TEST-TEST"},
|
|
{input: "test test", expected: "INPUT_TEST_TEST"},
|
|
}
|
|
|
|
for _, testCase := range cases {
|
|
t.Run(testCase.input, func(t *testing.T) {
|
|
formatted := FormatInputEnvKey(testCase.input)
|
|
|
|
if formatted != testCase.expected {
|
|
t.Errorf("Expected input env to be formatted as %s, got %s.", testCase.expected, formatted)
|
|
}
|
|
})
|
|
}
|
|
}
|