2014-02-15 00:56:09 +02:00
|
|
|
package ethutil
|
|
|
|
|
2014-02-24 13:11:42 +02:00
|
|
|
/*
|
2014-02-15 00:56:09 +02:00
|
|
|
import (
|
|
|
|
"math"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestCompile(t *testing.T) {
|
|
|
|
instr, err := CompileInstr("PUSH")
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
t.Error("Failed compiling instruction")
|
|
|
|
}
|
|
|
|
|
|
|
|
calc := (48 + 0*256 + 0*int64(math.Pow(256, 2)))
|
2014-02-24 00:43:18 +02:00
|
|
|
if BigD(instr).Int64() != calc {
|
2014-02-15 00:56:09 +02:00
|
|
|
t.Error("Expected", calc, ", got:", instr)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestValidInstr(t *testing.T) {
|
|
|
|
op, args, err := Instr("68163")
|
|
|
|
if err != nil {
|
|
|
|
t.Error("Error decoding instruction")
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestInvalidInstr(t *testing.T) {
|
|
|
|
}
|
2014-02-24 13:11:42 +02:00
|
|
|
*/
|