From f9befef0146931143d63b255717f990b857523b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francesc=20Ros=C3=A0s?= Date: Mon, 18 Apr 2016 14:59:42 -0700 Subject: [PATCH] Test case for incorrect parsing of quotes inside regular expressions --- test/dox.test.js | 10 ++++++++++ test/fixtures/regexp.js | 12 ++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 test/fixtures/regexp.js diff --git a/test/dox.test.js b/test/dox.test.js index c6bc1824..d3e49cdc 100644 --- a/test/dox.test.js +++ b/test/dox.test.js @@ -963,4 +963,14 @@ module.exports = { done(); }); }, + + 'test that quotes within regexpes are correctly handled': function (done) { + fixture('regexp.js', function (err, str){ + var comments = dox.parseComments(str); + comments.length.should.equal(2); + comments[0].description.full.should.equal("

A

"); + comments[1].description.full.should.equal("

B

"); + done(); + }); + }, }; diff --git a/test/fixtures/regexp.js b/test/fixtures/regexp.js new file mode 100644 index 00000000..0bf5dbe1 --- /dev/null +++ b/test/fixtures/regexp.js @@ -0,0 +1,12 @@ +/** + * A + */ +function a() { + /'"/; +}; + +/** + * B + */ +function b() { +};