From c20db1cf148ce3b06d6a97c24172d1d034995dbb Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Fri, 16 Sep 2016 15:44:27 -0400 Subject: [PATCH] blockchain: make scriptval_test fail more nicely Return early when failing on len(blocks) > 1. Check for len(blocks) == 0 so we can fail on that condition with an error message instead of a panic. --- blockchain/scriptval_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/blockchain/scriptval_test.go b/blockchain/scriptval_test.go index d1babb941..2368dd617 100644 --- a/blockchain/scriptval_test.go +++ b/blockchain/scriptval_test.go @@ -27,6 +27,11 @@ func TestCheckBlockScripts(t *testing.T) { } if len(blocks) > 1 { t.Errorf("The test block file must only have one block in it") + return + } + if len(blocks) == 0 { + t.Errorf("The test block file may not be empty") + return } storeDataFile := fmt.Sprintf("%d.utxostore.bz2", testBlockNum)