Missing Deletions
kylerobson opened this issue · comments
Kyle Robson commented
Checklist
- This is not a Apple's bug.
- Reviewed the README and documents.
- Searched existing issues for ensure not duplicated.
Expected Behavior
My StagedChangeset's stages should contain a deletion of indexes: [1]
Current Behavior
My StagedChangeset's stages contains deletions of [] for all stages.
Steps to Reproduce
// MockItem uses:
// Just `diffID` comparison for `differenceIdentifier`.
// Just `content` comparison for `isContentEqual`.
// Both `diffID` and `content` comparison for `==` `Equatable` implementation of `MockItem`.
let mock1a = MockItem(diffID: 1, content: "a")
let mock2 = MockItem(diffID: 2, content: "a")
let mock3a = MockItem(diffID: 3, content: "a")
let mock3b = MockItem(diffID: 3, content: "b")
let mock4 = MockItem(diffID: 4, content: "a")
let first = [mock1a, mock2, mock3a]
let second = [mock3b, mock1a, mock4]
Expect changes to contain three changes:
- Updates: [2]. Should transform [mock1a, mock2, mock3a] to [mock1a, mock2, mock3b].
- Deletes: [1]. Should transform [mock1a, mock2, mock3b] to [mock1a, mock3b].
- Inserts and Moves. Inserts: [2]. Moves: (0, 1) or (1, 0). Should transform [mock1a, mock3b] to [mock3b, mock1a, mock4].
Actual Deletes is [] instead of [1] during step (2).
Environments
-
Library version: Master
-
Swift version: 4.2
-
iOS version: 12
-
Xcode version: 10.1
-
Devices/Simulators: DifferenceKit, "My Mac", CMD+U
-
CocoaPods/Carthage version: N/A
Ryo Aoyama commented
@kylerobson
Was this ok to close?