good morning!!!!

Skip to content
Snippets Groups Projects
Commit ff44347e authored by Jeffrey Wilcke's avatar Jeffrey Wilcke
Browse files

fixed test

parent dda1d605
Branches
Tags
No related merge requests found
...@@ -2,11 +2,12 @@ package main ...@@ -2,11 +2,12 @@ package main
import ( import (
"fmt" "fmt"
"github.com/robertkrimen/otto"
"os" "os"
"path" "path"
"testing" "testing"
"github.com/robertkrimen/otto"
"github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
...@@ -141,10 +142,19 @@ func TestAccounts(t *testing.T) { ...@@ -141,10 +142,19 @@ func TestAccounts(t *testing.T) {
if err != nil { if err != nil {
t.Errorf("expected no error, got %v", err) t.Errorf("expected no error, got %v", err)
} }
addrs, ok := exp.([]string) interfaceAddr, ok := exp.([]interface{})
if !ok { 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:]) { if len(addrs) != 2 || (addr != addrs[0][2:] && addr != addrs[1][2:]) {
t.Errorf("expected addrs == [<default>, <new>], got %v (%v)", addrs, addr) t.Errorf("expected addrs == [<default>, <new>], got %v (%v)", addrs, addr)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment