Skip to content

Commit 1033df2

Browse files
committed
Add basic tests that API exposed for compiler plugin works without excluded dependencies
1 parent bd3936e commit 1033df2

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

dataframe-compiler-plugin-core/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ dependencies {
3131
exclude(group = "ch.randelshofer", module = "fastdoubleparser")
3232
exclude(group = "io.github.oshai", module = "kotlin-logging-jvm")
3333
}
34+
35+
// we assume Kotlin plugin has reflect dependency - we're not bringing our own version
36+
testImplementation(kotlin("reflect"))
37+
testImplementation(kotlin("test"))
3438
}
3539

3640
tasks.withType<ShadowJar> {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package org.jetbrains.kotlinx.dataframe
2+
3+
import org.jetbrains.kotlinx.dataframe.api.asColumn
4+
import org.jetbrains.kotlinx.dataframe.api.convert
5+
import org.jetbrains.kotlinx.dataframe.api.dataFrameOf
6+
import org.jetbrains.kotlinx.dataframe.api.map
7+
import org.jetbrains.kotlinx.dataframe.api.with
8+
import kotlin.test.Test
9+
10+
// Testing that even excluding dependencies required API still works without exceptions
11+
class PluginApiUsages {
12+
@Test
13+
fun convertWith() {
14+
dataFrameOf("a" to listOf("123"))
15+
.convert { col("a") }
16+
.with { it.toString() }
17+
}
18+
19+
@Test
20+
fun convertAsColumn() {
21+
dataFrameOf("a" to listOf("123"))
22+
.convert { col("a") }
23+
.asColumn { col -> col.map { it.toString() } }
24+
}
25+
}

0 commit comments

Comments
 (0)