From 1960b16a5147df3a4c61ac83b2f31cd8f811d609 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Thu, 23 May 2019 16:57:38 -0700 Subject: [PATCH] Make the output of the TestVerifyOnGoodDatabases a bit nicer --- verifier_test.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/verifier_test.go b/verifier_test.go index 8fc6bd4..993b88a 100644 --- a/verifier_test.go +++ b/verifier_test.go @@ -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) { @@ -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", @@ -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) + }) } }