diff options
| author | Christoph Schlosser <christophschlosser@users.noreply.github.com> | 2020-06-29 21:35:32 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-29 21:35:32 +0200 |
| commit | e689a0085cdd5329611a982f666104cec1477a03 (patch) | |
| tree | 3fa73e64752a60c0ea30dbe7e4533f36ac6f2995 /src/test | |
| parent | 07c77d40f5a84d7cf2bc1c0e99734d9e3742c0b0 (diff) | |
| download | doxdocgen-e689a0085cdd5329611a982f666104cec1477a03.tar.gz | |
Fix detection of closing comments (#162)
* Fix detection of closing comments
* Add tests
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/CppTests/Preprocessor.test.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/CppTests/Preprocessor.test.ts b/src/test/CppTests/Preprocessor.test.ts index c89a80a..7e4708b 100644 --- a/src/test/CppTests/Preprocessor.test.ts +++ b/src/test/CppTests/Preprocessor.test.ts @@ -30,4 +30,23 @@ suite("C++ - Preprocessor Tests", () => { ]).GetResult(); assert.equal("/**\n * @brief \n * \n */", result); }); + + // These two tests don't seem to belong here but the behavior they're testing only is reproducable + // for macros otherwise + test("detect auto generated closing */", () => { + const result = testSetup.SetLines([ + "*/", // simulate an auto generated closing block comment + "void foo(int bar);", + ]).GetResult(); + assert.equal("/**\n * @brief \n * \n * @param bar \n */", result); + }); + + test("don't detect closing */", () => { + const result = testSetup.SetLines([ + "/*", + " */", + "void foo(int bar);", + ]).GetResult(); + assert.equal("/**\n * @brief \n * \n */", result); + }); }); |