diff options
author | obscuren <obscuren@obscura.com> | 2013-12-28 05:32:55 +0800 |
---|---|---|
committer | obscuren <obscuren@obscura.com> | 2013-12-28 05:32:55 +0800 |
commit | 323ba36869126520c294b6c8acacfa9877cde5c7 (patch) | |
tree | 1b392cbde4624e0ee79959983191919ed34f3724 /rlp_test.go | |
parent | df0fe67fce8050dad60f0d0fca28a78da818832f (diff) | |
download | dexon-323ba36869126520c294b6c8acacfa9877cde5c7.tar.gz dexon-323ba36869126520c294b6c8acacfa9877cde5c7.tar.zst dexon-323ba36869126520c294b6c8acacfa9877cde5c7.zip |
Updated rlp encoding. (requires verification!)
Diffstat (limited to 'rlp_test.go')
-rw-r--r-- | rlp_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/rlp_test.go b/rlp_test.go new file mode 100644 index 000000000..922b70978 --- /dev/null +++ b/rlp_test.go @@ -0,0 +1,20 @@ +package main + +import ( + "testing" + "fmt" +) + +func TestEncode(t *testing.T) { + strRes := "Cdog" + str := string(Encode("dog")) + if str != strRes { + t.Error(fmt.Sprintf("Expected %q, got %q", strRes, str)) + } + + sliceRes := "\u0083CdogCgodCcat" + slice := string(Encode([]string{"dog", "god", "cat"})) + if slice != sliceRes { + t.Error(fmt.Sprintf("Expected %q, got %q", sliceRes, slice)) + } +} |