Skip to content
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

[test] Use @retroactive in test conformances #371

Open
wants to merge 1 commit into
base: release/1.1
Choose a base branch
from
Open
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
15 changes: 15 additions & 0 deletions Tests/BitCollectionsTests/BitSet.Counted Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,28 @@ import BitCollections
import OrderedCollections
#endif

#if compiler(>=6.0)
extension BitSet.Counted: @retroactive SetAPIChecker {}

extension BitSet.Counted: @retroactive SetAPIExtras {
public mutating func update(_ member: Int, at index: Index) -> Int {
fatalError("Not this one though")
}
}

extension BitSet.Counted: @retroactive SortedCollectionAPIChecker {}
#else
extension BitSet.Counted: SetAPIChecker {}

extension BitSet.Counted: SetAPIExtras {
public mutating func update(_ member: Int, at index: Index) -> Int {
fatalError("Not this one though")
}
}

extension BitSet.Counted: SortedCollectionAPIChecker {}
#endif


final class BitSetCountedTests: CollectionTestCase {
func test_union() {
Expand Down
14 changes: 14 additions & 0 deletions Tests/BitCollectionsTests/BitSetTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,27 @@ import BitCollections
import OrderedCollections
#endif

#if compiler(>=6.0)
extension BitSet: @retroactive SetAPIChecker {}

extension BitSet: @retroactive SetAPIExtras {
public mutating func update(_ member: Int, at index: Index) -> Int {
fatalError("Not this one though")
}
}

extension BitSet: @retroactive SortedCollectionAPIChecker {}
#else
extension BitSet: SetAPIChecker {}

extension BitSet: SetAPIExtras {
public mutating func update(_ member: Int, at index: Index) -> Int {
fatalError("Not this one though")
}
}

extension BitSet: SortedCollectionAPIChecker {}
#endif

final class BitSetTest: CollectionTestCase {
func test_empty_initializer() {
Expand Down
6 changes: 6 additions & 0 deletions Tests/HashTreeCollectionsTests/TreeDictionary Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ import _CollectionsTestSupport
import HashTreeCollections
#endif

#if compiler(>=6.0)
extension TreeDictionary: @retroactive DictionaryAPIChecker {}
extension TreeDictionary: @retroactive DictionaryAPIExtras {}
#else
extension TreeDictionary: DictionaryAPIChecker {}
extension TreeDictionary: DictionaryAPIExtras {}
#endif

class TreeDictionaryTests: CollectionTestCase {
func test_empty() {
Expand Down
4 changes: 4 additions & 0 deletions Tests/HashTreeCollectionsTests/TreeSet Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ import _CollectionsTestSupport
import HashTreeCollections
#endif

#if compiler(>=6.0)
extension TreeSet: @retroactive SetAPIExtras {}
#else
extension TreeSet: SetAPIExtras {}
#endif

class TreeSetTests: CollectionTestCase {
func test_init_empty() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ import XCTest
import _CollectionsTestSupport
#endif

#if compiler(>=6.0)
extension OrderedDictionary: @retroactive DictionaryAPIChecker {}
extension OrderedDictionary: @retroactive DictionaryAPIExtras {}
#else
extension OrderedDictionary: DictionaryAPIChecker {}
extension OrderedDictionary: DictionaryAPIExtras {}
#endif

class OrderedDictionaryTests: CollectionTestCase {
func test_empty() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ import XCTest
import _CollectionsTestSupport
#endif

#if compiler(>=6.0)
extension OrderedSet: @retroactive SetAPIChecker {}
extension OrderedSet: @retroactive SetAPIExtras {}
#else
extension OrderedSet: SetAPIChecker {}
extension OrderedSet: SetAPIExtras {}
#endif

class OrderedSetTests: CollectionTestCase {
func test_init_uncheckedUniqueElements_concrete() {
Expand Down