diff options
author | obscuren <geffobscura@gmail.com> | 2014-01-11 22:27:08 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-01-11 22:27:08 +0800 |
commit | 9571a512861d4a44c36d368f4baa15b2aa81c37d (patch) | |
tree | c5412a119ab885570351f42e512dd2d62d0bae61 /rlp_test.go | |
parent | 8bbf879cb31e9cb28700773ed788421f9935ac36 (diff) | |
download | go-tangerine-9571a512861d4a44c36d368f4baa15b2aa81c37d.tar go-tangerine-9571a512861d4a44c36d368f4baa15b2aa81c37d.tar.gz go-tangerine-9571a512861d4a44c36d368f4baa15b2aa81c37d.tar.bz2 go-tangerine-9571a512861d4a44c36d368f4baa15b2aa81c37d.tar.lz go-tangerine-9571a512861d4a44c36d368f4baa15b2aa81c37d.tar.xz go-tangerine-9571a512861d4a44c36d368f4baa15b2aa81c37d.tar.zst go-tangerine-9571a512861d4a44c36d368f4baa15b2aa81c37d.zip |
gofmt no coding standards
Diffstat (limited to 'rlp_test.go')
-rw-r--r-- | rlp_test.go | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/rlp_test.go b/rlp_test.go index 68676d030..65cf34b39 100644 --- a/rlp_test.go +++ b/rlp_test.go @@ -1,54 +1,54 @@ package main import ( - "testing" - "fmt" + "fmt" + "testing" ) func TestEncode(t *testing.T) { - strRes := "Cdog" + strRes := "Cdog" - bytes := 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) + str := string(bytes) + if str != strRes { + t.Error(fmt.Sprintf("Expected %q, got %q", strRes, str)) + } + //dec,_ := Decode(bytes, 0) - 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)) - } + 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) + //dec,_ = Decode(bytes, 0) } func TestMultiEncode(t *testing.T) { - inter := []interface{}{ - []interface{}{ - "1","2","3", - }, - []string{ - "string", - "string2", - "\x86A0J1234567890A\x00B20A0\x82F395843F657986", - "\x86A0J1234567890A\x00B20A0\x8cF395843F657986I335612448F524099H16716881A0H13114947G2039362G1507139H16719697G1048387E65360", - }, - "test", - } - - bytes := Encode(inter) - - Decode(bytes, 0) + inter := []interface{}{ + []interface{}{ + "1", "2", "3", + }, + []string{ + "string", + "string2", + "\x86A0J1234567890A\x00B20A0\x82F395843F657986", + "\x86A0J1234567890A\x00B20A0\x8cF395843F657986I335612448F524099H16716881A0H13114947G2039362G1507139H16719697G1048387E65360", + }, + "test", + } + + bytes := Encode(inter) + + Decode(bytes, 0) } func BenchmarkEncodeDecode(b *testing.B) { - for i := 0; i < b.N; i++ { - bytes := Encode([]string{"dog", "god", "cat"}) - Decode(bytes, 0) - } + for i := 0; i < b.N; i++ { + bytes := Encode([]string{"dog", "god", "cat"}) + Decode(bytes, 0) + } } |