+void KItemListSelectionManagerTest::testAnchoredSelectionAfterMovingItems()
+{
+ m_selectionManager->setCurrentItem(4);
+ m_selectionManager->beginAnchoredSelection(4);
+
+ // Reverse the items between 0 and 5.
+ m_selectionManager->itemsMoved(KItemRange(0, 6), {5, 4, 3, 2, 1, 0});
+
+ QCOMPARE(m_selectionManager->currentItem(), 1);
+ QCOMPARE(m_selectionManager->m_anchorItem, 1);
+
+ // Make 2 the current item -> 1 and 2 should be selected.
+ m_selectionManager->setCurrentItem(2);
+ QCOMPARE(m_selectionManager->selectedItems(), KItemSet() << 1 << 2);
+}
+