package main import ( "testing" "github.com/stretchr/testify/require" "go.uber.org/zap/zaptest" ) func TestValidateDomains(t *testing.T) { inputDomains := []string{ "s3dev.frostfs.devenv", "s3dev..frostfs.devenv", "s3dev..frostfs.devenv", "s3dev..frostfs.devenv", "s3dev..frostfs.devenv", ".frostfs.devenv", ".frostfs.devenv>", ".frostfs.devenv", "s3dev.fro.dev..frostfs.devenv", ".dev.ard>.frostfs.devenv", } expectedDomains := []string{ "s3dev.frostfs.devenv", "s3dev..frostfs.devenv", ".frostfs.devenv", ".dev..frostfs.devenv", } actualDomains := validateDomains(inputDomains, zaptest.NewLogger(t)) require.Equal(t, expectedDomains, actualDomains) }