Skip to content

Commit

Permalink
Make the output of the TestVerifyOnGoodDatabases a bit nicer
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwald committed May 23, 2019
1 parent 753ece0 commit 1960b16
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions verifier_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package maxminddb

import (
"github.com/stretchr/testify/assert"
"testing"

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

func TestVerifyOnGoodDatabases(t *testing.T) {
Expand All @@ -13,7 +15,7 @@ func TestVerifyOnGoodDatabases(t *testing.T) {
"test-data/test-data/GeoIP2-Country-Test.mmdb",
"test-data/test-data/GeoIP2-Domain-Test.mmdb",
"test-data/test-data/GeoIP2-ISP-Test.mmdb",
"test-data/test-data/GeoIP2-Precision-City-Test.mmdb",
"test-data/test-data/GeoIP2-Precision-Enterprise-Test.mmdb",
"test-data/test-data/MaxMind-DB-no-ipv4-search-tree.mmdb",
"test-data/test-data/MaxMind-DB-string-value-entries.mmdb",
"test-data/test-data/MaxMind-DB-test-decoder.mmdb",
Expand All @@ -30,9 +32,12 @@ func TestVerifyOnGoodDatabases(t *testing.T) {
}

for _, database := range databases {
reader, err := Open(database)
assert.Nil(t, err)
assert.Nil(t, reader.Verify(), "Received error (%v) when verifying %v", err, database)
t.Run(database, func(t *testing.T) {
reader, err := Open(database)
require.NoError(t, err)

assert.NoError(t, reader.Verify(), "Received error (%v) when verifying %v", err, database)
})
}
}

Expand Down

0 comments on commit 1960b16

Please sign in to comment.