@@ -115,6 +115,66 @@ describe('lib/rules/validate-jsdoc/check-redundant-params', function () {
115115 */
116116 function setTimeout ( callback , delay ) { }
117117 }
118+ } , {
119+ // issue #79
120+ it : 'should not report different names' ,
121+ code : function ( ) {
122+ /**
123+ * Example function
124+ * @param {Object } options - some options
125+ * @param {number } options.id - some id
126+ * @param {Array } rest - rest arguments
127+ */
128+ function hello ( options , rest ) {
129+ return ( options . filename ) ? true : false ;
130+ }
131+ } ,
132+ errors : [ ]
133+ } , {
134+ // issue #79
135+ it : 'should report with right location' ,
136+ code : function ( ) {
137+ /**
138+ * @param {Object } options - some options
139+ * @param {Array } rest - rest arguments
140+ */
141+ function hello ( options ) {
142+ }
143+ } ,
144+ errors : [ {
145+ column : 3 , line : 3 , filename : 'input' , rule : 'jsDoc' ,
146+ message : 'Found redundant param "rest" statement'
147+ } ]
148+ } , {
149+ it : 'should not report optional params' ,
150+ code : function ( ) {
151+ /**
152+ * Example function
153+ * @param {Object } options - some options
154+ * @param {number } options.id - some id
155+ * @param {Go } [optional] - optional param
156+ * @param {Go= } optional2 - another optional param
157+ * @param {Array } rest - rest arguments
158+ */
159+ function hello ( options , rest ) {
160+ }
161+ } ,
162+ errors : [ ]
163+ } , {
164+ it : 'should not report declared optional params' ,
165+ code : function ( ) {
166+ /**
167+ * Example function
168+ * @param {Object } options - some options
169+ * @param {number } options.id - some id
170+ * @param {Go } [optional] - optional param
171+ * @param {Go= } optional2 - another optional param
172+ * @param {Array } rest - rest arguments
173+ */
174+ function hello ( options , optional , optional2 , rest ) {
175+ }
176+ } ,
177+ errors : [ ]
118178 }
119179 /* jshint ignore:end */
120180 ] ) ;
0 commit comments