From 6d79aa5ff12944a90fd7a9658741d0b9b2ec549e Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Fri, 13 Jun 2014 09:46:31 -0500 Subject: [PATCH] Test panic for converting invalid sha strings. ok @davecgh --- internal_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 internal_test.go diff --git a/internal_test.go b/internal_test.go new file mode 100644 index 00000000..bb470dcc --- /dev/null +++ b/internal_test.go @@ -0,0 +1,14 @@ +package btcnet + +import ( + "testing" +) + +func TestInvalidShaStr(t *testing.T) { + defer func() { + if r := recover(); r == nil { + t.Errorf("Expected panic for invalid sha string, got nil") + } + }() + newShaHashFromStr("banana") +}