mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
We are no longer bound to the platform-specific directories, so simplify the test organization. If you don't want this change, just skip merging this PR. It's purely optional. I kept the platform-specific directories around under `kotlin`, but you could also easily merge all these together if you find them unhelpful. I'll leave that change to you.
61 lines
1.5 KiB
Kotlin
61 lines
1.5 KiB
Kotlin
fun source() = 1
|
|
|
|
fun sink(x: Any) { }
|
|
|
|
fun test(c: LibClass, sourcec: SourceClass, sinkc: SinkClass) {
|
|
|
|
sink(ConstructorWithDefaults(source(), 0)) // $ flow
|
|
sink(ConstructorWithDefaults(source())) // $ flow
|
|
|
|
sink(topLevelWithDefaults(source(), 0)) // $ flow
|
|
sink(topLevelWithDefaults(source())) // $ flow
|
|
|
|
sink("Hello world".extensionWithDefaults(source(), 0)) // $ flow
|
|
sink("Hello world".extensionWithDefaults(source())) // $ flow
|
|
|
|
sink(c.memberWithDefaults(source(), 0)) // $ flow
|
|
sink(c.memberWithDefaults(source())) // $ flow
|
|
|
|
sink(c.multiParameterTest(source(), 0, 0)) // $ flow
|
|
sink(c.multiParameterTest(0, source(), 0)) // $ flow
|
|
sink(c.multiParameterTest(0, 0, source()))
|
|
|
|
with(c) {
|
|
sink("Hello world".extensionMemberWithDefaults(source(), 0)) // $ flow
|
|
sink("Hello world".extensionMemberWithDefaults(source())) // $ flow
|
|
}
|
|
|
|
with(c) {
|
|
sink(source().multiParameterExtensionTest(0, 0)) // $ flow
|
|
sink(0.multiParameterExtensionTest(source(), 0)) // $ flow
|
|
sink(0.multiParameterExtensionTest(0, source()))
|
|
}
|
|
|
|
run {
|
|
val st = SomeToken()
|
|
topLevelArgSource(st)
|
|
sink(st) // $ flow
|
|
}
|
|
|
|
run {
|
|
val st = SomeToken()
|
|
"Hello world".extensionArgSource(st)
|
|
sink(st) // $ flow
|
|
}
|
|
|
|
run {
|
|
val st = SomeToken()
|
|
sourcec.memberArgSource(st)
|
|
sink(st) // $ flow
|
|
}
|
|
|
|
SinkClass(source()) // $ flow
|
|
topLevelSink(source()) // $ flow
|
|
"Hello world".extensionSink(source()) // $ flow
|
|
sinkc.memberSink(source()) // $ flow
|
|
with(sinkc) {
|
|
"Hello world".extensionMemberSink(source()) // $ flow
|
|
}
|
|
|
|
}
|