Fix possible array-out-of-bounds access, add test.

This commit is contained in:
David Anson 2015-07-22 23:17:08 -07:00
parent 7f5dd9ab6b
commit a958a33860
2 changed files with 25 additions and 1 deletions

View file

@ -189,6 +189,30 @@ module.exports.stringInputLineEndings = function stringInputLineEndings(test) {
});
};
module.exports.inputOnlyNewline = function inputOnlyNewline(test) {
test.expect(2);
var options = {
"strings": {
"cr": "\r",
"lf": "\n",
"crlf": "\r\n"
},
"config": {
"default": false
}
};
markdownlint(options, function callback(err, actualResult) {
test.ifError(err);
var expectedResult = {
"cr": {},
"lf": {},
"crlf": {}
};
test.deepEqual(actualResult, expectedResult, "Undetected issues.");
test.done();
});
};
module.exports.defaultTrue = function defaultTrue(test) {
test.expect(2);
var options = {