Fix handling of escaped characters in string

This commit is contained in:
Sébastien Arod
2015-10-29 14:55:23 +01:00
parent b60d88fa80
commit f5e73ab8bf
2 changed files with 19 additions and 2 deletions

View File

@@ -77,6 +77,22 @@ module ts {
}`, { config: { exclude: ["xx/*file.d.ts*/"] } });
});
it("handles escaped characters in strings correctly", () => {
assertParseResult(
`{
"exclude": [
"xx\\"//files"
]
}`, { config: { exclude: ["xx\"//files"] } });
assertParseResult(
`{
"exclude": [
"xx\\\\" // end of line comment
]
}`, { config: { exclude: ["xx\\"] } });
});
it("returns object with error when json is invalid", () => {
assertParseError("invalid");
});