File tree 3 files changed +42
-0
lines changed
test/fixtures/code_samples
3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,11 @@ func TestMatchingFiles(t *testing.T) {
92
92
Extension : ".rb" ,
93
93
Language : "Ruby" ,
94
94
},
95
+ {
96
+ FilePath : filepath .Join (codeSamplesDir , "Main.kt" ),
97
+ Extension : ".kt" ,
98
+ Language : "Kotlin" ,
99
+ },
95
100
},
96
101
},
97
102
{
@@ -144,6 +149,11 @@ func TestMatchingFiles(t *testing.T) {
144
149
Extension : ".rb" ,
145
150
Language : "Ruby" ,
146
151
},
152
+ {
153
+ FilePath : filepath .Join (codeSamplesDir , "Main.kt" ),
154
+ Extension : ".kt" ,
155
+ Language : "Kotlin" ,
156
+ },
147
157
},
148
158
},
149
159
{
@@ -196,6 +206,11 @@ func TestMatchingFiles(t *testing.T) {
196
206
Extension : ".rb" ,
197
207
Language : "Ruby" ,
198
208
},
209
+ {
210
+ FilePath : filepath .Join (codeSamplesDir , "Main.kt" ),
211
+ Extension : ".kt" ,
212
+ Language : "Kotlin" ,
213
+ },
199
214
},
200
215
},
201
216
{
Original file line number Diff line number Diff line change @@ -68,6 +68,11 @@ func TestScan(t *testing.T) {
68
68
Extension : ".rb" ,
69
69
Language : "Ruby" ,
70
70
},
71
+ {
72
+ FilePath : filepath .Join (codeSamplesDir , "Main.kt" ),
73
+ Extension : ".kt" ,
74
+ Language : "Kotlin" ,
75
+ },
71
76
}
72
77
73
78
expected := []scanResult {
@@ -134,6 +139,13 @@ func TestScan(t *testing.T) {
134
139
BlankLines : 4 ,
135
140
Comments : 8 ,
136
141
},
142
+ {
143
+ Metadata : files [9 ],
144
+ Lines : 15 ,
145
+ CodeLines : 7 ,
146
+ BlankLines : 3 ,
147
+ Comments : 5 ,
148
+ },
137
149
}
138
150
139
151
result , err := scanner .Scan (files )
Original file line number Diff line number Diff line change
1
+ fun main () {
2
+ println (" Hello, world" )
3
+
4
+ /* This is a block comment
5
+ * extending to 4 lines
6
+ * ends
7
+ */
8
+
9
+ val a = 5
10
+ val b = 6
11
+ // sum = a + b
12
+ val sum = a + b
13
+
14
+ println (sum)
15
+ }
You can’t perform that action at this time.
0 commit comments