aboutsummaryrefslogtreecommitdiffstats
path: root/rlp_test.go
diff options
context:
space:
mode:
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))
+ }
+}