Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
ff44347e
Commit
ff44347e
authored
Mar 25, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed test
parent
dda1d605
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
js_test.go
cmd/ethereum/js_test.go
+13
-3
No files found.
cmd/ethereum/js_test.go
View file @
ff44347e
...
...
@@ -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
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment