Kotlin: Add a numlines test

This commit is contained in:
Ian Lynagh
2022-10-10 19:04:11 +01:00
parent bca2586903
commit 591844f680
7 changed files with 47 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
| test.kt:2:1:4:1 | foo | 3 | 3 | 0 |
| test.kt:8:1:8:9 | getX | 1 | 1 | 0 |
| test.kt:18:1:18:17 | getY | 5 | 1 | 4 |
| test.kt:20:1:26:1 | Foo | 7 | 6 | 1 |
| test.kt:21:5:24:5 | bar | 4 | 3 | 1 |
| test.kt:25:5:25:21 | getSomeField | 1 | 1 | 0 |

View File

@@ -0,0 +1,4 @@
import java
from Callable c
select c, c.getTotalNumberOfLines(), c.getNumberOfLinesOfCode(), c.getNumberOfCommentLines()

View File

@@ -0,0 +1 @@
| test.kt:20:1:26:1 | Foo | 7 | 6 | 1 |

View File

@@ -0,0 +1,4 @@
import java
from Class c
select c, c.getTotalNumberOfLines(), c.getNumberOfLinesOfCode(), c.getNumberOfCommentLines()

View File

@@ -0,0 +1 @@
| test.kt:0:0:0:0 | test | 28 | 11 | 9 |

View File

@@ -0,0 +1,4 @@
import java
from File f
select f, f.getTotalNumberOfLines(), f.getNumberOfLinesOfCode(), f.getNumberOfCommentLines()

View File

@@ -0,0 +1,27 @@
fun foo ( x : Int ) {
val y = ( x + 1 )
}
// test
val x = 4
/*
test
*/
/**
test
*/
val y = 5 // test
class Foo {
fun bar() {
// comment
return
}
val someField = 3
}