Skip to content

Commit

Permalink
tests: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
natesales committed Aug 7, 2023
1 parent 0b4bc73 commit 5b7d9db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
run: go get github.com/jpoles1/gopherbadger && go install github.com/jpoles1/gopherbadger

- name: Run test
run: gopherbadger -style=for-the-badge -covercmd "go test -v -race -covermode atomic -coverprofile=cover.out ./... && go tool cover -func=cover.out"
run: gopherbadger -style=for-the-badge -covercmd "go test -v -covermode atomic -coverprofile=cover.out ./... && go tool cover -func=cover.out"

- name: Commit coverage badge
uses: EndBug/add-and-commit@v7
Expand Down
12 changes: 4 additions & 8 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,11 @@ func TestMainInferredServer(t *testing.T) {
assert.Nil(t, driver([]string{
"-v",
"-q", "example.com",
"@dns.quad9.net",
"@8.8.8.8",
"-t", "A",
}, &out))
time.Sleep(delay)
assert.Regexp(t, regexp.MustCompile(`example.com. .* A .*`), out.String())
assert.Regexp(t, regexp.MustCompile(`example.com. .* AAAA .*`), out.String())
assert.Regexp(t, regexp.MustCompile(`example.com. .* MX .*`), out.String())
assert.Regexp(t, regexp.MustCompile(`example.com. .* NS .*`), out.String())
}

func TestMainInvalidReverseQuery(t *testing.T) {
Expand Down Expand Up @@ -274,7 +272,7 @@ func TestMainTLSQuery(t *testing.T) {
"-v",
"-q", "example.com",
"-t", "A",
"@tls://dns.quad9.net",
"@tls://1.1.1.1",
}, &out))
time.Sleep(delay)
assert.Regexp(t, regexp.MustCompile(`example.com. .* A .*`), out.String())
Expand Down Expand Up @@ -341,12 +339,10 @@ func TestMainTLS12(t *testing.T) {
"--tls-min-version=1.1",
"--tls-max-version=1.2",
"@tls://dns.quad9.net",
"-t", "A",
}, &out))
time.Sleep(delay)
assert.Regexp(t, regexp.MustCompile(`example.com. .* A .*`), out.String())
assert.Regexp(t, regexp.MustCompile(`example.com. .* AAAA .*`), out.String())
assert.Regexp(t, regexp.MustCompile(`example.com. .* MX .*`), out.String())
assert.Regexp(t, regexp.MustCompile(`example.com. .* NS .*`), out.String())
}

func TestMainNSID(t *testing.T) {
Expand Down

0 comments on commit 5b7d9db

Please sign in to comment.