aboutsummaryrefslogtreecommitdiffstats
path: root/rlp_test.go
diff options
context:
space:
mode:
authorobscuren <obscuren@obscura.com>2013-12-28 05:32:55 +0800
committerobscuren <obscuren@obscura.com>2013-12-28 05:32:55 +0800
commit323ba36869126520c294b6c8acacfa9877cde5c7 (patch)
tree1b392cbde4624e0ee79959983191919ed34f3724 /rlp_test.go
parentdf0fe67fce8050dad60f0d0fca28a78da818832f (diff)
downloaddexon-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.go20
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))
+ }
+}