mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
Kotlin: Add tests for long comments
This commit is contained in:
4
java/ql/test/kotlin/library-tests/trap/comments.expected
Normal file
4
java/ql/test/kotlin/library-tests/trap/comments.expected
Normal file
@@ -0,0 +1,4 @@
|
||||
| long_comments.kt:11:1:11:1048575 | long_comments.kt:11:1:11:1048575 | 1048575 | //A01...BBBBC | KtComment |
|
||||
| long_comments.kt:12:1:12:1048576 | long_comments.kt:12:1:12:1048576 | 1048576 | //A02...BBBCD | KtComment |
|
||||
| long_comments.kt:13:1:13:1048577 | long_comments.kt:13:1:13:1048577 | 1048576 | //A03...BBBCD | KtComment |
|
||||
| long_comments.kt:14:1:14:1048578 | long_comments.kt:14:1:14:1048578 | 1048576 | //A04...BBBCD | KtComment |
|
||||
12
java/ql/test/kotlin/library-tests/trap/comments.ql
Normal file
12
java/ql/test/kotlin/library-tests/trap/comments.ql
Normal file
@@ -0,0 +1,12 @@
|
||||
import java
|
||||
|
||||
from KtComment c, string s, int len
|
||||
where s = c.getText()
|
||||
and len = s.length()
|
||||
// Ignore the comments that are describing what's going on, and only
|
||||
// select the large ones
|
||||
and len > 1000
|
||||
select c.getLocation(),
|
||||
len,
|
||||
s.prefix(5) + "..." + s.suffix(len - 5),
|
||||
c.getPrimaryQlClasses()
|
||||
15
java/ql/test/kotlin/library-tests/trap/long_comments.kt
Normal file
15
java/ql/test/kotlin/library-tests/trap/long_comments.kt
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user