Doubling down on the path testing
Maybe overdoing it a bit :)
This commit is contained in:
parent
7a61526705
commit
755eac5bbd
1 changed files with 15 additions and 13 deletions
|
@ -302,23 +302,25 @@ describe('HDNode', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// testing deriving path from the first child
|
// testing deriving path from children
|
||||||
var firstChild = master.derivePath(f.children[0].description)
|
f.children.forEach(function (c, i) {
|
||||||
|
var cn = master.derivePath(c.description)
|
||||||
|
|
||||||
f.children.slice(1).forEach(function (c) {
|
f.children.slice(i + 1).forEach(function (cc) {
|
||||||
it(c.description + ' from ' + f.children[0].fingerprint + ' by path', function () {
|
it(cc.description + ' from ' + c.fingerprint + ' by path', function () {
|
||||||
var path = c.description
|
var path = cc.description
|
||||||
|
|
||||||
var pathSplit = path.split('/').slice(2)
|
var pathSplit = path.split('/').slice(i + 2)
|
||||||
var pathEnd = pathSplit.join('/')
|
var pathEnd = pathSplit.join('/')
|
||||||
var pathEndM = 'm/' + path
|
var pathEndM = 'm/' + path
|
||||||
|
|
||||||
var child = firstChild.derivePath(pathEnd)
|
var child = cn.derivePath(pathEnd)
|
||||||
verifyVector(child, c, pathSplit.length + 1)
|
verifyVector(child, cc, pathSplit.length + i + 1)
|
||||||
|
|
||||||
assert.throws(function () {
|
assert.throws(function () {
|
||||||
firstChild.derivePath(pathEndM)
|
cn.derivePath(pathEndM)
|
||||||
}, /Not a master node/)
|
}, /Not a master node/)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue