Comparing version 1.14.1 to 1.15.1
{ | ||
"name": "jstreemap", | ||
"version": "1.14.1", | ||
"version": "1.15.1", | ||
"description": "Library of associative containers; it implements TreeMap, TreeSet, TreeMultiMap and TreeMultiSet classes", | ||
@@ -5,0 +5,0 @@ "main": "jstreemap.js", |
@@ -465,4 +465,6 @@ 'use strict'; | ||
if (this.head.size === 2) { | ||
// Root node must be BLACK | ||
child.color = BLACK; | ||
if (!this.isLeaf(child)) { | ||
// Root node must be BLACK | ||
child.color = BLACK; | ||
} | ||
} | ||
@@ -469,0 +471,0 @@ |
@@ -658,3 +658,3 @@ /*global should assert Tree TreeNode KeyValuePolicy ReverseIterator BLACK RED compare*/ | ||
it('erase; delete leftmost and root', function(done) { | ||
it('erase; delete leftmost and root, then root again', function(done) { | ||
let [t, n2, n1, n3] = buildTree(2, 1, 3); | ||
@@ -665,2 +665,4 @@ t.erase(n1); | ||
validatePointers(n3, null, t.head, t.head, 3, BLACK); | ||
t.erase(n3); | ||
validateHead(t.head, t.head, t.head, t.head, 0); | ||
@@ -670,2 +672,20 @@ done(); | ||
it('erase; delete 2 nodes, order 1', function(done) { | ||
let [t, n1, n3] = buildTree(1, 3); | ||
t.erase(n1); | ||
t.erase(n3); | ||
validateHead(t.head, t.head, t.head, t.head, 0); | ||
done(); | ||
}); | ||
it('erase; delete 2 nodes, order 2', function(done) { | ||
let [t, n1, n3] = buildTree(1, 3); | ||
t.erase(n3); | ||
t.erase(n1); | ||
validateHead(t.head, t.head, t.head, t.head, 0); | ||
done(); | ||
}); | ||
it('erase; delete rightmost child', function(done) { | ||
@@ -699,2 +719,4 @@ let [t, n2, n1, n3] = buildTree(2, 1, 3); | ||
validatePointers(n1, null, t.head, t.head, 1, BLACK); | ||
t.erase(n1); | ||
validateHead(t.head, t.head, t.head, t.head, 0); | ||
@@ -701,0 +723,0 @@ done(); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12696045
246815