Skip to content

Commit

Permalink
inclusive ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanis Benson committed Mar 26, 2019
1 parent a9154ed commit 1b21a22
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -52,7 +52,7 @@ class PortRangeIterator {

next() {
const value = this.nextValue;
if (value >= this.lastValue) {
if (value > this.lastValue) {
return {done: true};
}

Expand Down
4 changes: 2 additions & 2 deletions test.js
Expand Up @@ -114,6 +114,6 @@ test.serial('makeRange throws on invalid ranges', t => {
});

test.serial('makeRange produces valid ranges', t => {
t.deepEqual([...getPort.makeRange(1024, 1025)], [1024]);
t.deepEqual([...getPort.makeRange(1024, 1027)], [1024, 1025, 1026]);
t.deepEqual([...getPort.makeRange(1024, 1025)], [1024, 1025]);
t.deepEqual([...getPort.makeRange(1024, 1027)], [1024, 1025, 1026, 1027]);
});

0 comments on commit 1b21a22

Please sign in to comment.