Skip to content

Commit b07bad9

Browse files
improving tests
1 parent 3c0a96c commit b07bad9

File tree

1 file changed

+21
-11
lines changed
  • core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api

1 file changed

+21
-11
lines changed

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

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -284,17 +284,27 @@ class MoveTests {
284284
}
285285

286286
@Test
287-
fun `move single top level column to the start`() {
288-
val df = grouped.move("e").to(0, true)
289-
df.columnNames() shouldBe listOf("e", "q", "a", "b", "w", "r")
290-
df["e"].asColumnGroup().columnNames() shouldBe listOf("f")
291-
}
292-
293-
@Test
294-
fun `move multiple top level columns between columns`() {
295-
val df = grouped.move("w", "e").to(1, true)
296-
df.columnNames() shouldBe listOf("q", "w", "e", "a", "b", "r")
297-
df["e"].asColumnGroup().columnNames() shouldBe listOf("f")
287+
fun `move single top level column to the start, insideGroup should make no difference`() {
288+
// insideGroup is true
289+
val dfInsideGroupIsTrue = grouped.move("e").to(0, true)
290+
dfInsideGroupIsTrue.columnNames() shouldBe listOf("e", "q", "a", "b", "w", "r")
291+
dfInsideGroupIsTrue["e"].asColumnGroup().columnNames() shouldBe listOf("f")
292+
// insideGroup is false
293+
val dfInsideGroupIsFalse = grouped.move("e").to(0, false)
294+
dfInsideGroupIsFalse.columnNames() shouldBe listOf("e", "q", "a", "b", "w", "r")
295+
dfInsideGroupIsFalse["e"].asColumnGroup().columnNames() shouldBe listOf("f")
296+
}
297+
298+
@Test
299+
fun `move multiple top level columns between columns, insideGroup should make no difference`() {
300+
// insideGroup is true
301+
val dfInsideGroupIsTrue = grouped.move("w", "e").to(1, true)
302+
dfInsideGroupIsTrue.columnNames() shouldBe listOf("q", "w", "e", "a", "b", "r")
303+
dfInsideGroupIsTrue["e"].asColumnGroup().columnNames() shouldBe listOf("f")
304+
// insideGroup is false
305+
val dfInsideGroupIsFalse = grouped.move("w", "e").to(1, false)
306+
dfInsideGroupIsFalse.columnNames() shouldBe listOf("q", "w", "e", "a", "b", "r")
307+
dfInsideGroupIsFalse["e"].asColumnGroup().columnNames() shouldBe listOf("f")
298308
}
299309

300310
@Test

0 commit comments

Comments
 (0)