Skip to content

Commit d9b3726

Browse files
committed
Kotlin: Add test case for doc comment on init block
1 parent f5d43b8 commit d9b3726

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

java/ql/test/kotlin/library-tests/comments/comments.expected

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ comments
99
| comments.kt:37:5:37:23 | /** This is high */ | /** This is high */ |
1010
| comments.kt:42:5:44:6 | /**\n * A variable.\n */ | /**\n * A variable.\n */ |
1111
| comments.kt:48:1:50:3 | /**\n * A type alias comment\n */ | /**\n * A type alias comment\n */ |
12+
| comments.kt:54:5:56:7 | /**\n * An init block comment\n */ | /**\n * An init block comment\n */ |
1213
commentOwners
1314
| comments.kt:4:1:11:3 | /**\n * A group of *members*.\n *\n * This class has no useful logic; it's just a documentation example.\n *\n * @property name the name of this group.\n * @constructor Creates an empty group.\n */ | comments.kt:12:1:31:1 | Group |
1415
| comments.kt:4:1:11:3 | /**\n * A group of *members*.\n *\n * This class has no useful logic; it's just a documentation example.\n *\n * @property name the name of this group.\n * @constructor Creates an empty group.\n */ | comments.kt:12:1:31:1 | Group |
@@ -31,11 +32,13 @@ commentSections
3132
| comments.kt:37:5:37:23 | /** This is high */ | This is high |
3233
| comments.kt:42:5:44:6 | /**\n * A variable.\n */ | A variable. |
3334
| comments.kt:48:1:50:3 | /**\n * A type alias comment\n */ | A type alias comment |
35+
| comments.kt:54:5:56:7 | /**\n * An init block comment\n */ | An init block comment |
3436
commentSectionContents
3537
| A group of *members*.\n\nThis class has no useful logic; it's just a documentation example.\n\n | A group of *members*.\n\nThis class has no useful logic; it's just a documentation example.\n\n |
3638
| A type alias comment | A type alias comment |
3739
| A variable. | A variable. |
3840
| Adds a [member] to this group.\n | Adds a [member] to this group.\n |
41+
| An init block comment | An init block comment |
3942
| Creates an empty group. | Creates an empty group. |
4043
| Kdoc with no owner | Kdoc with no owner |
4144
| Medium is in the middle | Medium is in the middle |

java/ql/test/kotlin/library-tests/comments/comments.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,10 @@ fun fn1() {
4949
* A type alias comment
5050
*/
5151
typealias MyType = Group
52+
53+
class InitBlock {
54+
/**
55+
* An init block comment
56+
*/
57+
init { }
58+
}

0 commit comments

Comments
 (0)