aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2014-11-05 20:35:43 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2014-11-05 20:35:43 +0800
commit94b0ce84da875bac3847aec73479f1bcd680c1ed (patch)
treeabba4afba0e729f397b0c1d888290e75b71187a6
parente76c58d175dd5b50deb2d5fb4582adae4cd3f7ef (diff)
downloaddexon-94b0ce84da875bac3847aec73479f1bcd680c1ed.tar.gz
dexon-94b0ce84da875bac3847aec73479f1bcd680c1ed.tar.zst
dexon-94b0ce84da875bac3847aec73479f1bcd680c1ed.zip
Cleanup big_test.go
-rw-r--r--ethutil/big_test.go20
1 files changed, 15 insertions, 5 deletions
diff --git a/ethutil/big_test.go b/ethutil/big_test.go
index b26e58b5c..bf3c96c6d 100644
--- a/ethutil/big_test.go
+++ b/ethutil/big_test.go
@@ -1,7 +1,7 @@
package ethutil
import (
- "fmt"
+ "bytes"
"testing"
)
@@ -9,9 +9,11 @@ func TestMisc(t *testing.T) {
a := Big("10")
b := Big("57896044618658097711785492504343953926634992332820282019728792003956564819968")
c := []byte{1, 2, 3, 4}
- fmt.Println(b)
z := BitTest(a, 1)
- fmt.Println(z)
+
+ if z != true {
+ t.Error("Expected true got", z)
+ }
U256(a)
S256(a)
@@ -57,7 +59,15 @@ func TestBigCopy(t *testing.T) {
b := BigCopy(a)
c := Big("1000000000000")
y := BigToBytes(b, 16)
+ ybytes := []byte{0, 10}
z := BigToBytes(c, 16)
- fmt.Println(y)
- fmt.Println(z)
+ zbytes := []byte{232, 212, 165, 16, 0}
+
+ if bytes.Compare(y, ybytes) != 0 {
+ t.Error("Got", ybytes)
+ }
+
+ if bytes.Compare(z, zbytes) != 0 {
+ t.Error("Got", zbytes)
+ }
}