@@ -193,6 +193,86 @@ class ArrayDemo {
193
193
expect ( json [ "severity" ] ) . to eq ( CC ::Engine ::Analyzers ::Base ::MAJOR )
194
194
end
195
195
196
+ it "ignores comment docs and comments" do
197
+ create_source_file ( "foo.kt" , <<-EOF )
198
+ /*******************************************************************************
199
+ * *
200
+ * Copyright (C) 2017 by Max Lv <max.c.lv@gmail.com> *
201
+ * Copyright (C) 2017 by Mygod Studio <contact-shadowsocks-android@mygod.be> *
202
+ * *
203
+ * This program is free software: you can redistribute it and/or modify *
204
+ * it under the terms of the GNU General Public License as published by *
205
+ * the Free Software Foundation, either version 3 of the License, or *
206
+ * (at your option) any later version. *
207
+ * *
208
+ * This program is distributed in the hope that it will be useful, *
209
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
210
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
211
+ * GNU General Public License for more details. *
212
+ * *
213
+ * You should have received a copy of the GNU General Public License *
214
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. *
215
+ * *
216
+ *******************************************************************************/
217
+
218
+ package com.github.shadowsocks.acl
219
+ // Comment here
220
+
221
+ import org.junit.Assert
222
+ import org.junit.Test
223
+
224
+ class AclTest {
225
+ // Comment here
226
+ companion object {
227
+ private const val INPUT1 = """[proxy_all]
228
+ [bypass_list]
229
+ 1.0.1.0/24
230
+ (^|\. )4tern\. com${'$'}
231
+ """
232
+ }
233
+
234
+ @Test
235
+ fun parse() {
236
+ Assert.assertEquals(INPUT1, Acl().fromReader(INPUT1.reader()).toString());
237
+ }
238
+ }
239
+ EOF
240
+
241
+ create_source_file ( "bar.kt" , <<-EOF )
242
+ /*******************************************************************************
243
+ * *
244
+ * Copyright (C) 2017 by Max Lv <max.c.lv@gmail.com> *
245
+ * Copyright (C) 2017 by Mygod Studio <contact-shadowsocks-android@mygod.be> *
246
+ * *
247
+ * This program is free software: you can redistribute it and/or modify *
248
+ * it under the terms of the GNU General Public License as published by *
249
+ * the Free Software Foundation, either version 3 of the License, or *
250
+ * (at your option) any later version. *
251
+ * *
252
+ * This program is distributed in the hope that it will be useful, *
253
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
254
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
255
+ * GNU General Public License for more details. *
256
+ * *
257
+ * You should have received a copy of the GNU General Public License *
258
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. *
259
+ * *
260
+ *******************************************************************************/
261
+
262
+ package com.evernote.android.job
263
+ // Comment here
264
+
265
+ object JobConstants {
266
+ // Comment here
267
+ const val DATABASE_NAME = JobStorage.DATABASE_NAME
268
+ const val PREF_FILE_NAME = JobStorage.PREF_FILE_NAME
269
+ }
270
+ EOF
271
+
272
+ issues = run_engine ( engine_conf ) . strip . split ( "\0 " )
273
+ expect ( issues ) . to be_empty
274
+ end
275
+
196
276
end
197
277
end
198
278
end
0 commit comments