File: resolve_test.go

package info (click to toggle)
dmarc-cat 0.9.2-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 164 kB
  • sloc: xml: 104; makefile: 27
file content (23 lines) | stat: -rw-r--r-- 465 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package main

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestNullResolver_LookupAddr(t *testing.T) {
	var r NullResolver

	resp, err := r.LookupAddr("example.com")
	assert.NoError(t, err)
	assert.Equal(t, []string{"example.com"}, resp)
}

func TestRealResolver_LookupAddr(t *testing.T) {
	var r RealResolver

	resp, err := r.LookupAddr("8.8.8.8")
	assert.NoError(t, err)
	assert.Equal(t, []string{"google-public-dns-a.google.com."}, resp)
}