Add '\r' to line ending test, install through2 for example script.

This commit is contained in:
David Anson 2015-05-02 17:41:41 -07:00
parent 548e3d35cb
commit dab36c5afa
2 changed files with 4 additions and 2 deletions

View file

@ -16,7 +16,7 @@
"test-cover": "istanbul cover node_modules/nodeunit/bin/nodeunit", "test-cover": "istanbul cover node_modules/nodeunit/bin/nodeunit",
"debug": "node debug node_modules/nodeunit/bin/nodeunit", "debug": "node debug node_modules/nodeunit/bin/nodeunit",
"lint": "eslint lib test & eslint --rule \"no-console: 0, no-shadow: 0\" example", "lint": "eslint lib test & eslint --rule \"no-console: 0, no-shadow: 0\" example",
"example": "cd example & node standalone.js & grunt markdownlint & gulp markdownlint" "example": "npm install through2 & cd example & node standalone.js & grunt markdownlint & gulp markdownlint"
}, },
"dependencies": { "dependencies": {
"markdown-it": "^4.1.1" "markdown-it": "^4.1.1"

View file

@ -162,14 +162,16 @@ module.exports.stringInputLineEndings = function stringInputLineEndings(test) {
test.expect(2); test.expect(2);
var options = { var options = {
"strings": { "strings": {
"cr": "One\rTwo\r#Three",
"lf": "One\nTwo\n#Three", "lf": "One\nTwo\n#Three",
"crlf": "One\r\nTwo\r\n#Three", "crlf": "One\r\nTwo\r\n#Three",
"mixed": "One\r\nTwo\n#Three" "mixed": "One\rTwo\n#Three"
} }
}; };
markdownlint(options, function callback(err, actualResult) { markdownlint(options, function callback(err, actualResult) {
test.ifError(err); test.ifError(err);
var expectedResult = { var expectedResult = {
"cr": { "MD018": [ 3 ] },
"lf": { "MD018": [ 3 ] }, "lf": { "MD018": [ 3 ] },
"crlf": { "MD018": [ 3 ] }, "crlf": { "MD018": [ 3 ] },
"mixed": { "MD018": [ 3 ] } "mixed": { "MD018": [ 3 ] }