Skip to content

Commit

Permalink
add basic test for blocks package #59 (actually add file)
Browse files Browse the repository at this point in the history
  • Loading branch information
whyrusleeping committed Sep 15, 2014
1 parent 8a21af0 commit 782976f
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions blocks/blocks_test.go
@@ -0,0 +1,25 @@
package blocks

import "testing"

func TestBlocksBasic(t *testing.T) {

// Test empty data
empty := []byte{}
_, err := NewBlock(empty)
if err != nil {
t.Fatal(err)
}

// Test nil case
_, err = NewBlock(nil)
if err != nil {
t.Fatal(err)
}

// Test some data
_, err = NewBlock([]byte("Hello world!"))
if err != nil {
t.Fatal(err)
}
}

0 comments on commit 782976f

Please sign in to comment.