aboutsummaryrefslogtreecommitdiffstats
path: root/rlp_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'rlp_test.go')
-rw-r--r--rlp_test.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/rlp_test.go b/rlp_test.go
index 922b70978..c2d5ba263 100644
--- a/rlp_test.go
+++ b/rlp_test.go
@@ -7,14 +7,23 @@ import (
func TestEncode(t *testing.T) {
strRes := "Cdog"
- str := string(Encode("dog"))
+ bytes := Encode("dog")
+ str := string(bytes)
if str != strRes {
t.Error(fmt.Sprintf("Expected %q, got %q", strRes, str))
}
+ dec,_ := Decode(bytes, 0)
+ fmt.Printf("raw: %v encoded: %q == %v\n", dec, str, "dog")
- sliceRes := "\u0083CdogCgodCcat"
- slice := string(Encode([]string{"dog", "god", "cat"}))
+
+ sliceRes := "\x83CdogCgodCcat"
+ strs := []string{"dog", "god", "cat"}
+ bytes = Encode(strs)
+ slice := string(bytes)
if slice != sliceRes {
t.Error(fmt.Sprintf("Expected %q, got %q", sliceRes, slice))
}
+
+ dec,_ = Decode(bytes, 0)
+ fmt.Printf("raw: %v encoded: %q == %v\n", dec, slice, strs)
}