Skip to content

Commit 9d637a8

Browse files
committed
Create tests module
1 parent c97b0a5 commit 9d637a8

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ enableFeaturePreview("VERSION_CATALOGS")
66
includeBuild("generator")
77
include("plugins:dataframe-gradle-plugin")
88
include("plugins:symbol-processor")
9+
include("tests")
910

1011
//include("examples:idea-examples:titanic")
1112
//include("examples:idea-examples:movies")

tests/build.gradle.kts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
plugins {
2+
id("java")
3+
kotlin("jvm")
4+
kotlin("plugin.dataframe")
5+
}
6+
7+
group = "org.jetbrains.kotlinx"
8+
9+
repositories {
10+
mavenCentral()
11+
}
12+
13+
dependencies {
14+
implementation(project(":"))
15+
testImplementation(libs.junit)
16+
testImplementation(libs.kotestAssertions) {
17+
exclude("org.jetbrains.kotlin", "kotlin-stdlib-jdk8")
18+
}
19+
testImplementation(libs.kotlin.datetimeJvm)
20+
}
21+
22+
kotlin.sourceSets {
23+
main {
24+
kotlin.srcDir("build/generated/ksp/main/kotlin/")
25+
}
26+
test {
27+
kotlin.srcDir("build/generated/ksp/test/kotlin/")
28+
}
29+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package org.jetbrains.kotlinx.dataframe.api
2+
3+
import io.kotest.matchers.shouldBe
4+
import org.junit.Test
5+
6+
class ImplodeTests {
7+
8+
@Test
9+
fun `implode into`() {
10+
val df = dataFrameOf("a" to listOf(1, 1), "b" to listOf(2, 3))
11+
val imploded = df.implode { "b" into "c" }
12+
val expected = dataFrameOf("a" to listOf(1), "c" to listOf(listOf(2, 3)))
13+
imploded shouldBe expected
14+
}
15+
16+
@Test
17+
fun `implode all`() {
18+
val df = dataFrameOf("a" to listOf(1, 1), "b" to listOf(2, 3))
19+
df.implode() shouldBe df.implode { all() }[0]
20+
}
21+
}

0 commit comments

Comments
 (0)