package blocklist import ( "testing" "time" "git.k8s-git-k6n.net/mats/fancy-dns/internal/config" ) // TestInlineRulesGetTheResponseTTLInSeconds: the rule TTL is seconds, the config // value is a duration, and the two were once confused. func TestInlineRulesGetTheResponseTTLInSeconds(t *testing.T) { rules, _, err := parseInline([]string{"a.example"}, ActionBlock, config.Duration(90*time.Second)) if err != nil || len(rules) != 1 { t.Fatalf("%v %v", rules, err) } if rules[0].TTL != 90 { t.Errorf("rule TTL = %d, want 90", rules[0].TTL) } }