packageblocksimport"testing"funcTestBlocksBasic(t*testing.T){// Test empty dataempty:=[]byte{}_,err:=NewBlock(empty)iferr!=nil{t.Fatal(err)}// Test nil case_,err=NewBlock(nil)iferr!=nil{t.Fatal(err)}// Test some data_,err=NewBlock([]byte("Hello world!"))iferr!=nil{t.Fatal(err)}}