aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-25 17:31:58 +0800
committerobscuren <geffobscura@gmail.com>2015-03-25 17:31:58 +0800
commitff44347ea11a3c7034529a1e28fb4f9c148f4e17 (patch)
treebc9db6796f00ffcae6803076f5af5835a22dc9f9
parentdda1d605565caad90597fd7d0e5126838cef3e9c (diff)
downloaddexon-ff44347ea11a3c7034529a1e28fb4f9c148f4e17.tar.gz
dexon-ff44347ea11a3c7034529a1e28fb4f9c148f4e17.tar.zst
dexon-ff44347ea11a3c7034529a1e28fb4f9c148f4e17.zip
fixed test
-rw-r--r--cmd/ethereum/js_test.go16
1 files changed, 13 insertions, 3 deletions
diff --git a/cmd/ethereum/js_test.go b/cmd/ethereum/js_test.go
index e3806d24d..a6058b318 100644
--- a/cmd/ethereum/js_test.go
+++ b/cmd/ethereum/js_test.go
@@ -2,11 +2,12 @@ package main
import (
"fmt"
- "github.com/robertkrimen/otto"
"os"
"path"
"testing"
+ "github.com/robertkrimen/otto"
+
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
@@ -141,10 +142,19 @@ func TestAccounts(t *testing.T) {
if err != nil {
t.Errorf("expected no error, got %v", err)
}
- addrs, ok := exp.([]string)
+ interfaceAddr, ok := exp.([]interface{})
if !ok {
- t.Errorf("expected []string, got %v", err)
+ t.Errorf("expected []string, got %T", exp)
}
+
+ addrs := make([]string, len(interfaceAddr))
+ for i, addr := range interfaceAddr {
+ var ok bool
+ if addrs[i], ok = addr.(string); !ok {
+ t.Errorf("expected addrs[%d] to be string. Got %T instead", i, addr)
+ }
+ }
+
if len(addrs) != 2 || (addr != addrs[0][2:] && addr != addrs[1][2:]) {
t.Errorf("expected addrs == [<default>, <new>], got %v (%v)", addrs, addr)
}