Files

46 lines
719 B
Go
Raw Permalink Normal View History

2026-08-19 20:50:03 +01:00
package httpserver
2022-11-17 21:19:17 +00:00
import (
"testing"
"github.com/stretchr/testify/require"
)
var (
testCaseInput = []string{
"some-computer-name.local",
"Hello.local",
"I'm an input.locally",
"some-plain-input",
"smol",
}
)
func TestRemoveSuffix(t *testing.T) {
tce := []string{
"some-computer-name",
"Hello",
"I'm an input.locally",
"some-plain-input",
"smol",
}
for i, tci := range testCaseInput {
require.Equal(t, tce[i], RemoveSuffix(tci, local))
}
}
func TestParseHostname(t *testing.T) {
tce := []string{
"some computer name",
"Hello",
"I'm an input.locally",
"some plain input",
"smol",
}
for i, tci := range testCaseInput {
require.Equal(t, tce[i], parseHostname(tci))
}
}