Skip to content

Commit

Permalink
Fixed syntax problems
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Curl committed Aug 14, 2014
1 parent 89a491a commit eed6f49
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/data_structures/heap.js
Expand Up @@ -53,14 +53,15 @@ describe('Min Heap', function () {

assert(h.isEmpty());
});
it('should perform a function to all elements from smallest to largest' +

it('should perform a function to all elements from smallest to largest' +
' with forEach', function () {
var h = new heap.MinHeap();
h.heapify([3, 10, 1000, 0, 2, 1]);

var output = [];
h.forEach(function (n) {
output.push(n);
output.push(n);
});

assert.deepEqual(output, [0, 1, 2, 3, 10, 1000]);
Expand Down Expand Up @@ -118,14 +119,14 @@ describe('Max Heap', function () {
assert(h.isEmpty());
});

it('should perform a function to all elements from largest to smallest' +
it('should perform a function to all elements from largest to smallest' +
' with forEach', function () {
var h = new heap.MaxHeap();
h.heapify([3, 10, 1000, 0, 2, 1]);

var output = [];
h.forEach(function (n) {
output.push(n);
output.push(n);
});

assert.deepEqual(output, [1000, 10, 3, 2, 1, 0]);
Expand Down

0 comments on commit eed6f49

Please sign in to comment.