aboutsummaryrefslogtreecommitdiff
path: root/test-utils/testData/api/docString.kt
blob: 1432c05a3d1259329857e0ffaa592c95ba681144 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/*
 * Copyright 2020 Google LLC
 * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// TEST PROCESSOR: DocStringProcessor
// EXPECTED:
// <init>: \n This is a java doc\n\n This is a second line\n\n more lines\n
// <init>: \n inner class\n
// <init>: \n nest class\n
// <init>: \n top level class\n\n doc can have multiple lines\n\n third non-empty line\n
// Inner: \n inner class\n
// JavaSrc: \n This is a java doc\n\n This is a second line\n\n more lines\n
// Nested: \n nest class\n
// TopClass: \n top level class\n\n doc can have multiple lines\n\n third non-empty line\n
// f1: \n top level function\n
// f2: \n member function\n
// foo: \n\n\n member function\n\n
// j1: \n field\n
// j2: null
// j3: null
// v1: \n\n top level property\n\n
// v2:  Irregular doc comment 1
// v3: \n Irregular doc comment 2
// v4: Irregular doc comment 3 *\n
// v5: \n owned doc comment\n
// v6: null
// v7: null
// v8: \n member property\n
// END
// FILE: KotlinSrc.kt

/**
 * top level function
 */
fun f1() = 0

/**
 *
 * top level property
 *
 */
val v1 = 0


/** * Irregular doc comment 1***/
val v2 = 0

/**
 * Irregular doc comment 2*/
val v3 = 0

/** Irregular doc comment 3 *
 */
val v4 = 0

/**
 * unassociated doc comment
 */
/**
 * owned doc comment
 */
val v5 = 0

/* Not doc comment 1 */
val v6 = 0

// Not doc comment 2
val v7 = 0

/**
 * top level class
 *
 * doc can have multiple lines
 *
 * third non-empty line
 */
class TopClass {
    /**
     * nest class
     */
    class Nested

    /**
     * inner class
     */
    class Inner

    /**
     * member function
     */
    fun f2() = 0

    /**
     * member property
     */
    val v8 = 0
}

// FILE: JavaSrc.java
/**
 * This is a java doc
 *
 * This is a second line
 *
 * more lines
 */
class JavaSrc {
    /**
     *
     *
     * member function
     *
     */
    int foo() {
        return 0;
    }

    /**
     * field
     */
    int j1 = 0;

    // Not a doc
    int j2 = 0;

    /* Not a doc */
    int j3 = 0;
}