Skip to content

Commit 47f64a3

Browse files
committed
added List.toDataFrame() test with local class
1 parent b9f4783 commit 47f64a3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/constructors.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class ConstructorsTests {
3838
@Suppress("ktlint:standard:argument-list-wrapping")
3939
@Test
4040
fun `dataFrameOf with local class`() {
41+
// issue #928
4142
data class Car(val type: String, val model: String)
4243

4344
val cars: DataFrame<*> = dataFrameOf("owner", "car")(
@@ -50,5 +51,13 @@ class ConstructorsTests {
5051
val unfolded = cars.unfold("car")
5152
unfolded["car"]["type"].type shouldBe typeOf<String>()
5253
unfolded["car"]["model"].type shouldBe typeOf<String>()
54+
55+
val cars2 = listOf(
56+
Car("audi", "a8"),
57+
Car("toyota", "corolla"),
58+
).toDataFrame()
59+
60+
cars2["type"].type shouldBe typeOf<String>()
61+
cars2["model"].type shouldBe typeOf<String>()
5362
}
5463
}

0 commit comments

Comments
 (0)