aboutsummaryrefslogtreecommitdiffstats
path: root/rlp_test.go
blob: 922b7097810a92c0072f613f7722eafe7be42aa7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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))
  }
}