Skip to content

Commit

Permalink
Adding some tests double checking deleting things that don't exist wo…
Browse files Browse the repository at this point in the history
…n''t be an issue
  • Loading branch information
avoidwork committed Feb 10, 2017
1 parent a429da6 commit e208b76
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/lru.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports.suite = {
done();
},
direct: function (test) {
test.expect(21);
test.expect(25);
test.equal(this.cache.length, 0, "Should be '0'");
test.equal(this.cache.max, 2, "Should be '2'");
test.equal(this.cache.set("test1", {prop: true}).length, 1, "Should be '1'");
Expand All @@ -29,6 +29,10 @@ exports.suite = {
test.equal(this.cache.length, 0, "Should be '0'");
test.equal(this.cache.first, null, "Should be 'null'");
test.equal(this.cache.last, null, "Should be 'null'");
test.equal(this.cache.delete("test4"), undefined, "Should be 'undefined'");
test.equal(this.cache.set("test4", null).length, 1, "Should be '1'");
test.equal(this.cache.delete("test4").prop, null, "Should be 'null'");
test.equal(this.cache.delete("test4"), undefined, "Should be 'undefined'");
test.done();
}
};

0 comments on commit e208b76

Please sign in to comment.