Skip to content

Commit

Permalink
Fixed variable names and comments
Browse files Browse the repository at this point in the history
PR-URL: npm#315
Credit: @raphaelzulliger
Close: npm#315
Reviewed-by: @isaacs
  • Loading branch information
raphaelzulliger authored and isaacs committed Apr 15, 2020
1 parent ce978f9 commit 226e6dc
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion test/fixtures/version-gt-range.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// [range, version, loose]
// [range, version, options]
// Version should be greater than range
module.exports = [
['~1.2.2', '1.3.0'],
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/version-lt-range.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// [range, version, loose]
// [range, version, options]
// Version should be less than range
module.exports = [
['~1.2.2', '1.2.1'],
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/version-not-gt-range.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// [range, version, loose]
// [range, version, options]
// Version should NOT be greater than range
module.exports = [
['~0.6.1-1', '0.6.1-1'],
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/version-not-lt-range.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// [range, version, loose]
// [range, version, options]
// Version should NOT be less than range
module.exports = [
['~ 1.0', '1.1.0'],
Expand Down
16 changes: 8 additions & 8 deletions test/ranges/gtr.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@ const versionGtr = require('../fixtures/version-gt-range')
const versionNotGtr = require('../fixtures/version-not-gt-range')

test('gtr tests', (t) => {
// [range, version, loose]
// [range, version, options]
// Version should be greater than range
versionGtr.forEach((tuple) => {
const range = tuple[0]
const version = tuple[1]
const loose = tuple[2] || false
const msg = `gtr(${version}, ${range}, ${loose})`
t.ok(gtr(version, range, loose), msg)
const options = tuple[2] || false
const msg = `gtr(${version}, ${range}, ${options})`
t.ok(gtr(version, range, options), msg)
})
t.end()
})

test('negative gtr tests', (t) => {
// [range, version, loose]
// [range, version, options]
// Version should NOT be greater than range
versionNotGtr.forEach((tuple) => {
const range = tuple[0]
const version = tuple[1]
const loose = tuple[2] || false
const msg = `!gtr(${version}, ${range}, ${loose})`
t.notOk(gtr(version, range, loose), msg)
const options = tuple[2] || false
const msg = `!gtr(${version}, ${range}, ${options})`
t.notOk(gtr(version, range, options), msg)
})
t.end()
})
16 changes: 8 additions & 8 deletions test/ranges/ltr.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ const versionLtr = require('../fixtures/version-lt-range')
const versionNotLtr = require('../fixtures/version-not-lt-range')

test('ltr tests', (t) => {
// [range, version, loose]
// [range, version, options]
// Version should be less than range
versionLtr.forEach(([range, version, loose = false]) => {
const msg = `ltr(${version}, ${range}, ${loose})`
t.ok(ltr(version, range, loose), msg)
versionLtr.forEach(([range, version, options = false]) => {
const msg = `ltr(${version}, ${range}, ${options})`
t.ok(ltr(version, range, options), msg)
})
t.end()
})

test('negative ltr tests', (t) => {
// [range, version, loose]
// [range, version, options]
// Version should NOT be less than range
versionNotLtr.forEach(([range, version, loose = false]) => {
const msg = `!ltr(${version}, ${range}, ${loose})`
t.notOk(ltr(version, range, loose), msg)
versionNotLtr.forEach(([range, version, options = false]) => {
const msg = `!ltr(${version}, ${range}, ${options})`
t.notOk(ltr(version, range, options), msg)
})
t.end()
})
32 changes: 16 additions & 16 deletions test/ranges/outside.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,41 @@ const versionLtr = require('../fixtures/version-lt-range')
const versionNotLtr = require('../fixtures/version-not-lt-range')

test('gtr tests', (t) => {
// [range, version, loose]
// [range, version, options]
// Version should be greater than range
versionGtr.forEach(([range, version, loose = false]) => {
const msg = `outside(${version}, ${range}, > ${loose})`
t.ok(outside(version, range, '>', loose), msg)
versionGtr.forEach(([range, version, options = false]) => {
const msg = `outside(${version}, ${range}, > ${options})`
t.ok(outside(version, range, '>', options), msg)
})
t.end()
})

test('ltr tests', (t) => {
// [range, version, loose]
// [range, version, options]
// Version should be less than range
versionLtr.forEach(([range, version, loose = false]) => {
const msg = `outside(${version}, ${range}, <, ${loose})`
t.ok(outside(version, range, '<', loose), msg)
versionLtr.forEach(([range, version, options = false]) => {
const msg = `outside(${version}, ${range}, <, ${options})`
t.ok(outside(version, range, '<', options), msg)
})
t.end()
})

test('negative gtr tests', (t) => {
// [range, version, loose]
// [range, version, options]
// Version should NOT be greater than range
versionNotGtr.forEach(([range, version, loose = false]) => {
const msg = `!outside(${version}, ${range}, > ${loose})`
t.notOk(outside(version, range, '>', loose), msg)
versionNotGtr.forEach(([range, version, options = false]) => {
const msg = `!outside(${version}, ${range}, > ${options})`
t.notOk(outside(version, range, '>', options), msg)
})
t.end()
})

test('negative ltr tests', (t) => {
// [range, version, loose]
// [range, version, options]
// Version should NOT be less than range
versionNotLtr.forEach(([range, version, loose = false]) => {
const msg = `!outside(${version}, ${range}, < ${loose})`
t.notOk(outside(version, range, '<', loose), msg)
versionNotLtr.forEach(([range, version, options = false]) => {
const msg = `!outside(${version}, ${range}, < ${options})`
t.notOk(outside(version, range, '<', options), msg)
})
t.end()
})
Expand Down

0 comments on commit 226e6dc

Please sign in to comment.