| 1 | package dnsscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/ |
| 2 | |
| 3 | import "testingscip-go gomod github.com/golang/go/src go1.25.0 testing/" |
| 4 | |
| 5 | func TestDedupscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/TestDedup().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 6 | testcases := map[[3]RRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/RR#][]string{ |
| 7 | [...]RRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/RR#{ |
| 8 | testRRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/testRR().("mIek.nl. IN A 127.0.0.1"), |
| 9 | testRRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/testRR().("mieK.nl. IN A 127.0.0.1"), |
| 10 | testRRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/testRR().("miek.Nl. IN A 127.0.0.1"), |
| 11 | }: {"mIek.nl.\t3600\tIN\tA\t127.0.0.1"}, |
| 12 | [...]RRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/RR#{ |
| 13 | testRRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/testRR().("miEk.nl. 2000 IN A 127.0.0.1"), |
| 14 | testRRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/testRR().("mieK.Nl. 1000 IN A 127.0.0.1"), |
| 15 | testRRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/testRR().("Miek.nL. 500 IN A 127.0.0.1"), |
| 16 | }: {"miEk.nl.\t500\tIN\tA\t127.0.0.1"}, |
| 17 | [...]RRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/RR#{ |
| 18 | testRRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/testRR().("miek.nl. IN A 127.0.0.1"), |
| 19 | testRRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/testRR().("miek.nl. CH A 127.0.0.1"), |
| 20 | testRRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/testRR().("miek.nl. IN A 127.0.0.1"), |
| 21 | }: {"miek.nl.\t3600\tIN\tA\t127.0.0.1", |
| 22 | "miek.nl.\t3600\tCH\tA\t127.0.0.1", |
| 23 | }, |
| 24 | [...]RRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/RR#{ |
| 25 | testRRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/testRR().("miek.nl. CH A 127.0.0.1"), |
| 26 | testRRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/testRR().("miek.nl. IN A 127.0.0.1"), |
| 27 | testRRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/testRR().("miek.de. IN A 127.0.0.1"), |
| 28 | }: {"miek.nl.\t3600\tCH\tA\t127.0.0.1", |
| 29 | "miek.nl.\t3600\tIN\tA\t127.0.0.1", |
| 30 | "miek.de.\t3600\tIN\tA\t127.0.0.1", |
| 31 | }, |
| 32 | [...]RRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/RR#{ |
| 33 | testRRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/testRR().("miek.de. IN A 127.0.0.1"), |
| 34 | testRRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/testRR().("miek.nl. 200 IN A 127.0.0.1"), |
| 35 | testRRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/testRR().("miek.nl. 300 IN A 127.0.0.1"), |
| 36 | }: {"miek.de.\t3600\tIN\tA\t127.0.0.1", |
| 37 | "miek.nl.\t200\tIN\tA\t127.0.0.1", |
| 38 | }, |
| 39 | } |
| 40 | |
| 41 | for rr, expected := range testcases { |
| 42 | out := Dedupscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/Dedup().([]RRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/RR#{rr[0], rr[1], rr[2]}, nil) |
| 43 | for i, o := range out { |
| 44 | if o.Stringscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/RR#String.() != expected[i] { |
| 45 | t.Fatalfscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Fatalf().("expected %v, got %v", expected[i], o.Stringscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/RR#String.()) |
| 46 | } |
| 47 | } |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | func BenchmarkDedupscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/BenchmarkDedup().(b *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Bscip-go gomod github.com/golang/go/src go1.25.0 testing/B#) { |
| 52 | rrs := []RRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/RR#{ |
| 53 | testRRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/testRR().("miEk.nl. 2000 IN A 127.0.0.1"), |
| 54 | testRRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/testRR().("mieK.Nl. 1000 IN A 127.0.0.1"), |
| 55 | testRRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/testRR().("Miek.nL. 500 IN A 127.0.0.1"), |
| 56 | } |
| 57 | m := make(map[string]RRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/RR#) |
| 58 | for i := 0; i < b.Nscip-go gomod github.com/golang/go/src go1.25.0 testing/B#N.; i++ { |
| 59 | Dedupscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/Dedup().(rrs, m) |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | func TestNormalizedStringscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/TestNormalizedString().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 64 | tests := map[RRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/RR#]string{ |
| 65 | testRRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/testRR().("mIEk.Nl. 3600 IN A 127.0.0.1"): "miek.nl.\tIN\tA\t127.0.0.1", |
| 66 | testRRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/testRR().("m\\ iek.nL. 3600 IN A 127.0.0.1"): "m\\ iek.nl.\tIN\tA\t127.0.0.1", |
| 67 | testRRscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/testRR().("m\\\tIeK.nl. 3600 in A 127.0.0.1"): "m\\009iek.nl.\tIN\tA\t127.0.0.1", |
| 68 | } |
| 69 | for tc, expected := range tests { |
| 70 | n := normalizedStringscip-go gomod github.com/miekg/dns . `github.com/miekg/dns`/normalizedString().(tc) |
| 71 | if n != expected { |
| 72 | t.Errorfscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Errorf().("expected %s, got %s", expected, n) |
| 73 | } |
| 74 | } |
| 75 | } |