dnscontrol/providers/domainnameshop/dns_test.go
Tom Limoncelli ccb582b278
CHORE: Linting (#1704)
* Remove deprecated io/ioutil
* fixup!
* staticcheck and linting
* revert models/provider.go
* Fix imports to new style
* linting
2022-08-14 20:46:56 -04:00

26 lines
475 B
Go

package domainnameshop
import "testing"
func TestFixTTL(t *testing.T) {
for i, test := range []struct {
given, expected uint32
}{
{1, minAllowedTTL},
{multiplierTTL*5 - 1, multiplierTTL * 4},
{maxAllowedTTL + 1, maxAllowedTTL},
{0, 60},
{59, 60},
{60, 60},
{61, 60},
{119, 60},
{120, 120},
{121, 120},
} {
found := fixTTL(test.given)
if found != test.expected {
t.Errorf("Test %d: Expected %d, but was %d", i, test.expected, found)
}
}
}