fix: remove duplicate test declarations from PR #12/#13 conflict
CI / test (push) Has been cancelled
CI / test (push) Has been cancelled
Phase 4.2 (PR #12) and test coverage improvement (PR #13) independently added overlapping test functions. Remove duplicates from PR #13 files: - internal/dns/iterative_test.go: remove TestExtractNSNames, TestExtractNSNamesEmpty, TestIterativeQueryWithExchangeSuccess, TestIterativeQueryWithExchangeNilResponse, TestIterativeQueryWithExchangeTCPFallback (kept in roots_test.go and query_test.go from PR #12) - internal/output/coverage_test.go: remove TestRRDataStringDefault, TestContainsString, TestCollectUniqueServerIPs, TestNewFormatterNilWriter (kept in stats_test.go and formatter_test.go from PR #12) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
co-authored by
Copilot
multica-agent
parent
dbd9322a1b
commit
dd667f734c
@@ -52,18 +52,6 @@ func TestRRDataString(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRRDataStringDefault(t *testing.T) {
|
||||
soa := &miekgdns.SOA{
|
||||
Hdr: miekgdns.RR_Header{Name: "example.com.", Rrtype: miekgdns.TypeSOA, Class: miekgdns.ClassINET, Ttl: 3600},
|
||||
Ns: "ns1.example.com.",
|
||||
Mbox: "admin.example.com.",
|
||||
}
|
||||
got := rrDataString(soa)
|
||||
if got == "" {
|
||||
t.Error("expected non-empty string for SOA default case")
|
||||
}
|
||||
}
|
||||
|
||||
func TestSummaryTypeLabel(t *testing.T) {
|
||||
cases := []struct {
|
||||
input string
|
||||
@@ -87,22 +75,6 @@ func TestSummaryTypeLabel(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainsString(t *testing.T) {
|
||||
items := []string{"a", "b", "c"}
|
||||
if !containsString(items, "a") {
|
||||
t.Error("containsString should find 'a'")
|
||||
}
|
||||
if !containsString(items, "c") {
|
||||
t.Error("containsString should find 'c'")
|
||||
}
|
||||
if containsString(items, "d") {
|
||||
t.Error("containsString should not find 'd'")
|
||||
}
|
||||
if containsString(nil, "a") {
|
||||
t.Error("containsString on nil should return false")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCollectServers(t *testing.T) {
|
||||
ref := traverse.NewReferral("example.com.", dns.TypeA, "com.", 1, 0.5, nil)
|
||||
resp := &traverse.Response{
|
||||
@@ -848,20 +820,6 @@ func TestJSONFormatterWriteProgressShowProgressFalse(t *testing.T) {
|
||||
|
||||
// ---- runner.go coverage ----
|
||||
|
||||
func TestCollectUniqueServerIPs(t *testing.T) {
|
||||
ref := traverse.NewReferral("example.com.", dns.TypeA, ".", 0, 1.0, nil)
|
||||
results := []traverse.TraversalResult{
|
||||
{Referral: ref, Response: &traverse.Response{Server: net.ParseIP("1.2.3.4"), Referral: ref, Type: traverse.RespAnswer}},
|
||||
{Referral: ref, Response: &traverse.Response{Server: net.ParseIP("1.2.3.4"), Referral: ref, Type: traverse.RespAnswer}}, // duplicate
|
||||
{Referral: ref, Response: &traverse.Response{Server: net.ParseIP("5.6.7.8"), Referral: ref, Type: traverse.RespAnswer}},
|
||||
{Referral: ref, Response: nil},
|
||||
}
|
||||
ips := collectUniqueServerIPs(results)
|
||||
if len(ips) != 2 {
|
||||
t.Errorf("expected 2 unique IPs, got %d", len(ips))
|
||||
}
|
||||
}
|
||||
|
||||
func TestRunTraversalNilTraverser(t *testing.T) {
|
||||
_, err := RunTraversal(context.Background(), nil, nil, nil, "example.com")
|
||||
if err == nil {
|
||||
@@ -876,13 +834,6 @@ func TestNewFormatterNilConfig(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewFormatterNilWriter(t *testing.T) {
|
||||
f := NewFormatter(DefaultConfig(), nil)
|
||||
if f == nil {
|
||||
t.Fatal("NewFormatter with nil writer should not return nil")
|
||||
}
|
||||
}
|
||||
|
||||
func TestAttachHooksNilCfg(t *testing.T) {
|
||||
h := AttachHooks(nil, nil)
|
||||
if h != nil {
|
||||
|
||||
Reference in New Issue
Block a user