mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-17 14:37:02 +00:00
test: Add small miscellaneous tests
This patch extends various packages and integration tests, increasing test coverage. They're small enough that it's not worth splitting them up, as it would add a lot of noise to the history.
This commit is contained in:
37
internal/tlsconst/tlsconst_test.go
Normal file
37
internal/tlsconst/tlsconst_test.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package tlsconst
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestVersionName(t *testing.T) {
|
||||
cases := []struct {
|
||||
ver uint16
|
||||
expected string
|
||||
}{
|
||||
{0x0302, "TLS-1.1"},
|
||||
{0x1234, "TLS-0x1234"},
|
||||
}
|
||||
for _, c := range cases {
|
||||
got := VersionName(c.ver)
|
||||
if got != c.expected {
|
||||
t.Errorf("VersionName(%x) = %q, expected %q",
|
||||
c.ver, got, c.expected)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestCipherSuiteName(t *testing.T) {
|
||||
cases := []struct {
|
||||
suite uint16
|
||||
expected string
|
||||
}{
|
||||
{0xc073, "TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384"},
|
||||
{0x1234, "TLS_UNKNOWN_CIPHER_SUITE-0x1234"},
|
||||
}
|
||||
for _, c := range cases {
|
||||
got := CipherSuiteName(c.suite)
|
||||
if got != c.expected {
|
||||
t.Errorf("CipherSuiteName(%x) = %q, expected %q",
|
||||
c.suite, got, c.expected)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user