Skip to content

SE-0036 (1/3): Update existing tests for the upcoming implementation #2841

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -157,23 +157,23 @@ internal enum _CollectionOperation : Equatable {
var newElementsIds = elementsLastMutatedStateIds
var newEndIndexId = endIndexLastMutatedStateId
switch self {
case reserveCapacity:
case .reserveCapacity:
let invalidIndices = newElementsIds.indices
newElementsIds.replaceSubrange(
Range(invalidIndices),
with: repeatElement(nextStateId, count: invalidIndices.count))
newEndIndexId = nextStateId

case append:
case .append:
newElementsIds.append(nextStateId)
newEndIndexId = nextStateId

case appendContentsOf(let count):
case .appendContentsOf(let count):
newElementsIds.append(contentsOf:
repeatElement(nextStateId, count: count))
newEndIndexId = nextStateId

case replaceRange(let subRange, let replacementCount):
case .replaceRange(let subRange, let replacementCount):
newElementsIds.replaceSubrange(
subRange,
with: repeatElement(nextStateId, count: replacementCount))
Expand All @@ -184,7 +184,7 @@ internal enum _CollectionOperation : Equatable {
with: repeatElement(nextStateId, count: invalidIndices.count))
newEndIndexId = nextStateId

case insert(let atIndex):
case .insert(let atIndex):
newElementsIds.insert(nextStateId, at: atIndex)

let invalidIndices = atIndex..<newElementsIds.endIndex
Expand All @@ -193,7 +193,7 @@ internal enum _CollectionOperation : Equatable {
with: repeatElement(nextStateId, count: invalidIndices.count))
newEndIndexId = nextStateId

case insertContentsOf(let atIndex, let count):
case .insertContentsOf(let atIndex, let count):
newElementsIds.insert(
contentsOf: repeatElement(nextStateId, count: count),
at: atIndex)
Expand All @@ -204,7 +204,7 @@ internal enum _CollectionOperation : Equatable {
with: repeatElement(nextStateId, count: invalidIndices.count))
newEndIndexId = nextStateId

case removeAtIndex(let index):
case .removeAtIndex(let index):
newElementsIds.remove(at: index)

let invalidIndices = index..<newElementsIds.endIndex
Expand All @@ -213,11 +213,11 @@ internal enum _CollectionOperation : Equatable {
with: repeatElement(nextStateId, count: invalidIndices.count))
newEndIndexId = nextStateId

case removeLast:
case .removeLast:
newElementsIds.removeLast()
newEndIndexId = nextStateId

case removeRange(let subRange):
case .removeRange(let subRange):
newElementsIds.removeSubrange(subRange)

let invalidIndices = subRange.lowerBound..<newElementsIds.endIndex
Expand All @@ -226,7 +226,7 @@ internal enum _CollectionOperation : Equatable {
with: repeatElement(nextStateId, count: invalidIndices.count))
newEndIndexId = nextStateId

case removeAll(let keepCapacity):
case .removeAll(let keepCapacity):
newElementsIds.removeAll(keepingCapacity: keepCapacity)
newEndIndexId = nextStateId
}
Expand Down
Loading