Fix for broken /*!* test. (hat tip tschaub)

This commit is contained in:
Michael Mathews 2011-09-24 08:26:00 +01:00
parent de4f31b46e
commit dbc9c428a6
3 changed files with 15 additions and 5 deletions

View File

@ -122,7 +122,7 @@ function pretreat(code) {
// make lent objectliterals documentable by giving them a dummy name
.replace(/(\/\*\*[\s\S]*?@lends\b[\s\S]*?\*\/\s*)\{/g, '$1____ = {')
// make starbangstar comments look like real jsdoc comments
.replace(/\/\*\!\*/g, '/***');
.replace(/\/\*\!\*/g, '/**');
}
/**

View File

@ -1,7 +1,12 @@
/**
/*!*
* Script that does something awesome
*
* @copyright (c) 2011 Rotorz Limited. All rights reserved.
* @author Lea Hayes
* @module myscript/core
*/
/*!*********************************
* This should be ignored by JSDoc
* @var x
*/

View File

@ -1,9 +1,14 @@
(function() {
var docSet = testhelpers.getDocSetFromFile('test/cases/starbangstar.js'),
mod = docSet.getByLongname('module:myscript/core')[0];
mod = docSet.getByLongname('module:myscript/core')[0],
x = docSet.getByLongname('module:myscript/core.x')[0];
test('When doclet starts wuth /*!* it, it is treated as a JSDoc comment.', function() {
assert.equal(mod.description, 'Script that does something awesome');
});
test('When doclet starts wuth /*!** it, it is not treated as a JSDoc comment.', function() {
assert.equal(typeof x, 'undefined');
});
})();