parsing_test.go 505 B

1234567891011121314151617181920212223242526272829303132
  1. package ethutil
  2. import (
  3. "math"
  4. "testing"
  5. )
  6. func TestCompile(t *testing.T) {
  7. instr, err := CompileInstr("PUSH")
  8. if err != nil {
  9. t.Error("Failed compiling instruction")
  10. }
  11. calc := (48 + 0*256 + 0*int64(math.Pow(256, 2)))
  12. if Big(instr).Int64() != calc {
  13. t.Error("Expected", calc, ", got:", instr)
  14. }
  15. }
  16. func TestValidInstr(t *testing.T) {
  17. /*
  18. op, args, err := Instr("68163")
  19. if err != nil {
  20. t.Error("Error decoding instruction")
  21. }
  22. */
  23. }
  24. func TestInvalidInstr(t *testing.T) {
  25. }