Add test to simulate typing each test file to validate handling of partial input.

This commit is contained in:
David Anson 2015-05-07 17:42:13 -07:00
parent 6a8f31ddad
commit 43f28b90c1

View file

@ -647,3 +647,23 @@ module.exports.doc = function doc(test) {
test.done(); test.done();
}); });
}; };
module.exports.typeAllFiles = function typeAllFiles(test) {
// Simulates typing each test file to validate handling of partial input
var files = fs.readdirSync("./test");
files.forEach(function forFile(file) {
if (/\.md$/.test(file)) {
var content = fs.readFileSync(
path.join("./test", file), shared.utf8Encoding);
while (content) {
markdownlint.sync({
"strings": {
"content": content
}
});
content = content.slice(0, -1);
}
}
});
test.done();
};