Kotlin: Add an integration test for file classes

This commit is contained in:
Ian Lynagh
2023-07-11 13:22:50 +01:00
parent c21797dd3c
commit 2162530729
6 changed files with 20 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
fun a() {
}

View File

@@ -0,0 +1,3 @@
fun b() {
a()
}

View File

@@ -0,0 +1,3 @@
class C {
fun c() {}
}

View File

@@ -0,0 +1,3 @@
| AKt.class:0:0:0:0 | AKt | false |
| B.kt:0:0:0:0 | BKt | true |
| C.kt:1:1:3:1 | C | false |

View File

@@ -0,0 +1,5 @@
import java
from Class c
where exists(c.getLocation().getFile().getRelativePath())
select c, any(boolean b | if c.isFileClass() then b = true else b = false)

View File

@@ -0,0 +1,4 @@
from create_database_utils import *
runSuccessfully([get_cmd("kotlinc"), 'A.kt'])
run_codeql_database_create(['kotlinc -cp . B.kt C.kt'], lang="java")