Skip to content
Permalink
Browse files

test: add tests for hasItems method in FreeList

PR-URL: #27588
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information...
rpgeeganage authored and Trott committed May 6, 2019
1 parent a608caa commit ac56dc96e32a4f9468c869fc5af293129c20a6cd
Showing with 10 additions and 0 deletions.
  1. +10 −0 test/parallel/test-freelist.js
@@ -28,3 +28,13 @@ assert.strictEqual(flist1.free({ id: 'test5' }), false);
assert.strictEqual(flist1.alloc().id, 'test3');
assert.strictEqual(flist1.alloc().id, 'test2');
assert.strictEqual(flist1.alloc().id, 'test1');

// Check list has elements
const flist2 = new FreeList('flist2', 2, Object);
assert.strictEqual(flist2.hasItems(), false);

flist2.free({ id: 'test1' });
assert.strictEqual(flist2.hasItems(), true);

flist2.alloc();
assert.strictEqual(flist2.hasItems(), false);

0 comments on commit ac56dc9

Please sign in to comment.
You can’t perform that action at this time.