From c6a88160435c2cac4a719f699ff7a2566ec96e6e Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Wed, 18 Mar 2020 19:14:35 -0700 Subject: [PATCH] channeldb: mark ApplyMigration as a test helper With this change, errors from migrations will have the proper local line number. --- channeldb/migtest/migtest.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/channeldb/migtest/migtest.go b/channeldb/migtest/migtest.go index d970769e..51a2006e 100644 --- a/channeldb/migtest/migtest.go +++ b/channeldb/migtest/migtest.go @@ -41,6 +41,8 @@ func ApplyMigration(t *testing.T, beforeMigration, afterMigration, migrationFunc func(tx kvdb.RwTx) error, shouldFail bool) { + t.Helper() + cdb, cleanUp, err := MakeDB() defer cleanUp() if err != nil { @@ -55,6 +57,8 @@ func ApplyMigration(t *testing.T, } defer func() { + t.Helper() + if r := recover(); r != nil { err = newError(r) }