mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
fix: validate that parameter names are unique (#7882)
This commit is contained in:
16
coderd/util/strings/strings_test.go
Normal file
16
coderd/util/strings/strings_test.go
Normal file
@ -0,0 +1,16 @@
|
||||
package strings_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/coder/coder/coderd/util/strings"
|
||||
)
|
||||
|
||||
func TestJoinWithConjunction(t *testing.T) {
|
||||
t.Parallel()
|
||||
require.Equal(t, "foo", strings.JoinWithConjunction([]string{"foo"}))
|
||||
require.Equal(t, "foo and bar", strings.JoinWithConjunction([]string{"foo", "bar"}))
|
||||
require.Equal(t, "foo, bar and baz", strings.JoinWithConjunction([]string{"foo", "bar", "baz"}))
|
||||
}
|
Reference in New Issue
Block a user