Files
gluetun/internal/provider/utils/cipher_test.go

42 lines
677 B
Go
Raw Normal View History

package utils
import (
"testing"
"github.com/stretchr/testify/assert"
)
func Test_CipherLines(t *testing.T) {
t.Parallel()
testCases := map[string]struct {
ciphers []string
version string
lines []string
}{
"empty version": {
ciphers: []string{"AES"},
lines: []string{
2024-05-02 07:57:11 +00:00
"cipher AES",
"ncp-ciphers AES",
},
},
2024-05-02 07:57:11 +00:00
"2.4": {
ciphers: []string{"AES", "CBC"},
2024-05-02 07:57:11 +00:00
version: "2.4",
lines: []string{
2024-05-02 07:57:11 +00:00
"cipher AES",
"ncp-ciphers AES:CBC",
},
},
}
for name, testCase := range testCases {
t.Run(name, func(t *testing.T) {
t.Parallel()
lines := CipherLines(testCase.ciphers)
assert.Equal(t, testCase.lines, lines)
})
}
}