fix decoding of empty strings

This commit is contained in:
Jeromy
2016-10-24 17:30:53 -07:00
parent 460554fb6e
commit 02ce4e9b23
3 changed files with 13 additions and 2 deletions

View File

@@ -52,6 +52,13 @@ func TestBasicMarshaling(t *testing.T) {
assertEqual(t, cid, out2)
}
func TestEmptyString(t *testing.T) {
_, err := Decode("")
if err == nil {
t.Fatal("shouldnt be able to parse an empty cid")
}
}
func TestV0Handling(t *testing.T) {
old := "QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n"