Asserts added to tests

This commit is contained in:
Gonzalo Bellver
2012-01-12 17:54:18 -03:00
parent cf9bdee1c4
commit b8e8038b39
2 changed files with 58 additions and 27 deletions

View File

@@ -107,13 +107,19 @@ mindplot.nlayout.RootedTreeSet = new Class({
return result;
},
getChildren:function(node) {
$assert(node, 'node can not be null');
getChildren: function(node) {
$assert(node, 'node cannot be null');
return node._children;
},
getSiblings: function(node) {
$assert(node, 'node cannot be null');
var siblings = node._parent._children;
return siblings.erase(node);
},
getParent:function(node) {
$assert(node, 'node can not be null');
$assert(node, 'node cannot be null');
return node._parent;
},