mirror of
https://github.com/apple/swift-collections
synced 2026-11-24 04:27:53 +00:00
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>
27 lines
857 B
Swift
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) })
|
|
}
|
|
}
|