Commit f524411f authored by Jeromy's avatar Jeromy

add basic test for blocks package #59 (actually add file)

parent ab55ab95
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)
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment