Files
Joseph CursioandClaude Opus 5.5 6f570e0ad8 Add checkSetAlgebraMemberIdentity
Check which of two equal but distinguishable members insert(_:),
update(with:) and remove(_:) keep and return, using Set as the
reference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:44:55 -05:00

27 lines
857 B
Swift

//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Collections open source project
//
// Copyright (c) 2026 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
//
// SPDX-License-Identifier: Apache-2.0 WITH Swift-exception
//
//===----------------------------------------------------------------------===//
import XCTest
#if !COLLECTIONS_SINGLE_MODULE
import _CollectionsTestSupport
#endif
final class SetAlgebraMemberIdentityTests: CollectionTestCase {
func testSet() {
checkSetAlgebraMemberIdentity(
Set<LifetimeTracked<Int>>.self,
models: [[], [0], [0, 1, 2, 3], Set(stride(from: 0, to: 200, by: 2))],
members: { Array($0) })
}
}