Skip to content

Commit

Permalink
Enhance tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevina committed Aug 1, 2018
1 parent 08a753f commit 70097b5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,22 @@ func TestV0Handling(t *testing.T) {
if cid.String() != old {
t.Fatal("marshaling roundtrip failed")
}

new, err := cid.StringOfBase(mbase.Base58BTC)
if err != nil {
t.Fatal(err)
}
if new != old {
t.Fatal("StringOfBase roundtrip failed")
}

encoder, err := mbase.NewEncoder(mbase.Base58BTC)
if err != nil {
t.Fatal(err)
}
if cid.Encode(encoder) != old {
t.Fatal("Encode roundtrip failed")
}
}

func TestV0ErrorCases(t *testing.T) {
Expand Down

0 comments on commit 70097b5

Please sign in to comment.