add an example to the tests to play around with the feature

This commit is contained in:
Jeromy
2017-03-18 19:17:44 -07:00
parent a22bf1e2bf
commit 92cac2f002
3 changed files with 30 additions and 9 deletions

View File

@@ -202,6 +202,18 @@ func TestHexDecode(t *testing.T) {
}
}
func ExampleDecode() {
encoded := "zb2rhhFAEMepUBbGyP1k8tGfz7BSciKXP6GHuUeUsJBaK6cqG"
c, err := Decode(encoded)
if err != nil {
fmt.Printf("Error: %s", err)
return
}
fmt.Println(c)
// Output: zb2rhhFAEMepUBbGyP1k8tGfz7BSciKXP6GHuUeUsJBaK6cqG
}
func TestFromJson(t *testing.T) {
cval := "zb2rhhFAEMepUBbGyP1k8tGfz7BSciKXP6GHuUeUsJBaK6cqG"
jsoncid := []byte(`{"/":"` + cval + `"}`)