This repository has been archived by the owner on Dec 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fix in handling 0 for opts.min and opts.max
Proper validation of min and max optimization min=0 or max=0 bug fix for Integer matcher. Refacotring integer and number matchers.
- Loading branch information
Mehdi Valikhani
committed
Mar 19, 2015
1 parent
50aadc5
commit 8b41a04
Showing
6 changed files
with
131 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
var hasValue = function(val){ | ||
return (typeof val !== 'undefined') && (val !== null); | ||
} | ||
|
||
var isNumber = function(val){ | ||
return typeof val === 'number'; | ||
} | ||
|
||
module.exports = { | ||
hasValue: hasValue, | ||
isNumber: isNumber | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
var utils = require('../lib/utils'); | ||
var hasValue = utils.hasValue; | ||
|
||
describe("hasValue() util function", function(){ | ||
it('Should return false when value is <null>', function(){ | ||
hasValue(null).should.be.false; | ||
}); | ||
|
||
it('Should return false when value is <undefined>', function(){ | ||
hasValue(undefined).should.be.false; | ||
}); | ||
|
||
it('Should return true when value is a number', function(){ | ||
hasValue(12).should.be.true; | ||
}); | ||
|
||
it('Should return true when value is a string', function(){ | ||
hasValue('a').should.be.true; | ||
}); | ||
|
||
it('Should return true when value is <{}>', function(){ | ||
hasValue({}).should.be.true; | ||
}); | ||
|
||
it('Should return true when value is <"">', function(){ | ||
hasValue('').should.be.true; | ||
}); | ||
}); |