courgette/internal/actions/act_test.go

27 lines
577 B
Go
Raw Normal View History

2024-09-02 16:28:23 +00:00
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)
}
})
}
}