Skip to content

Commit 180b5d0

Browse files
add test
1 parent 4a0c0bb commit 180b5d0

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/testSets/person/DataFrameTreeTests.kt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import org.jetbrains.kotlinx.dataframe.api.asDataFrame
2525
import org.jetbrains.kotlinx.dataframe.api.asFrame
2626
import org.jetbrains.kotlinx.dataframe.api.asGroupBy
2727
import org.jetbrains.kotlinx.dataframe.api.at
28+
import org.jetbrains.kotlinx.dataframe.api.before
2829
import org.jetbrains.kotlinx.dataframe.api.by
2930
import org.jetbrains.kotlinx.dataframe.api.cast
3031
import org.jetbrains.kotlinx.dataframe.api.colsOf
@@ -702,6 +703,22 @@ class DataFrameTreeTests : BaseTest() {
702703
typed2.insert(colName) { nameAndCity.name.reversed() }.after { nameAndCity.name }.check()
703704
}
704705

706+
@Test
707+
fun `insert column before`() {
708+
val colName = "reversed"
709+
710+
fun DataFrame<GroupedPerson>.check() {
711+
nameAndCity.columnsCount() shouldBe 3
712+
nameAndCity.columnNames() shouldBe listOf(
713+
typed2.nameAndCity.name.name(),
714+
colName,
715+
typed2.nameAndCity.city.name(),
716+
)
717+
}
718+
719+
typed2.insert(colName) { nameAndCity.name.reversed() }.before { nameAndCity.city }.check()
720+
}
721+
705722
@Test
706723
fun append() {
707724
val res = typed2.append(listOf("Bill", "San Francisco"), null, 66)

0 commit comments

Comments
 (0)