@@ -11,23 +11,23 @@ import Foundation
11
11
import XCTest
12
12
@testable import BTree
13
13
14
- func assertEqualElements< Element: Equatable , S1: Sequence , S2: Sequence > ( _ a: S1 , _ b: S2 , file: StaticString = #file, line: UInt = #line) where S1. Iterator . Element == Element , S2. Iterator . Element == Element {
14
+ func assertEqualElements< Element: Equatable , S1: Sequence , S2: Sequence > ( _ a: S1 , _ b: S2 , file: StaticString = #file, line: UInt = #line) where S1. Element == Element , S2. Element == Element {
15
15
let aa = Array ( a)
16
16
let ba = Array ( b)
17
17
if !aa. elementsEqual ( ba) {
18
18
XCTFail ( " XCTAssertEqual failed: \" \( aa) \" is not equal to \" \( ba) \" " , file: file, line: line)
19
19
}
20
20
}
21
21
22
- func assertEqualElements< T1: Equatable , T2: Equatable , S1: Sequence , S2: Sequence > ( _ a: S1 , _ b: S2 , file: StaticString = #file, line: UInt = #line) where S1. Iterator . Element == ( T1 , T2 ) , S2. Iterator . Element == ( T1 , T2 ) {
22
+ func assertEqualElements< T1: Equatable , T2: Equatable , S1: Sequence , S2: Sequence > ( _ a: S1 , _ b: S2 , file: StaticString = #file, line: UInt = #line) where S1. Element == ( T1 , T2 ) , S2. Element == ( T1 , T2 ) {
23
23
let aa = Array ( a)
24
24
let ba = Array ( b)
25
25
if !aa. elementsEqual ( ba, by: { a, b in a. 0 == b. 0 && a. 1 == b. 1 } ) {
26
26
XCTFail ( " XCTAssertEqual failed: \" \( aa) \" is not equal to \" \( ba) \" " , file: file, line: line)
27
27
}
28
28
}
29
29
30
- func assertEqualElements< Element: Equatable , S1: Sequence , S2: Sequence , S1W: Sequence , S2W: Sequence > ( _ a: S1 , _ b: S2 , element: Element . Type = Element . self, file: StaticString = #file, line: UInt = #line) where S1. Iterator . Element == S1W , S2. Iterator . Element == S2W , S1W. Iterator . Element == Element , S2W. Iterator . Element == Element {
30
+ func assertEqualElements< Element: Equatable , S1: Sequence , S2: Sequence , S1W: Sequence , S2W: Sequence > ( _ a: S1 , _ b: S2 , element: Element . Type = Element . self, file: StaticString = #file, line: UInt = #line) where S1. Element == S1W , S2. Element == S2W , S1W. Element == Element , S2W. Element == Element {
31
31
let aa = a. map { Array ( $0) }
32
32
let ba = b. map { Array ( $0) }
33
33
if !aa. elementsEqual ( ba, by: { $0. elementsEqual ( $1) } ) {
@@ -41,14 +41,14 @@ extension BTree {
41
41
assertEqualElements ( self . map { $0. 0 } , other. map { $0. 0 } , file: file, line: line)
42
42
}
43
43
44
- internal func assertKeysEqual< S: Sequence > ( _ s: S , file: StaticString = #file, line: UInt = #line) where S. Iterator . Element == Key {
44
+ internal func assertKeysEqual< S: Sequence > ( _ s: S , file: StaticString = #file, line: UInt = #line) where S. Element == Key {
45
45
assertEqualElements ( self . map { $0. 0 } , s, file: file, line: line)
46
46
}
47
47
}
48
48
49
49
internal extension Sequence {
50
- func repeatEach( _ count: Int ) -> Array < Iterator . Element > {
51
- var result : [ Iterator . Element ] = [ ]
50
+ func repeatEach( _ count: Int ) -> Array < Element > {
51
+ var result : [ Element ] = [ ]
52
52
result. reserveCapacity ( count * underestimatedCount)
53
53
for element in self {
54
54
for _ in 0 ..< count {
0 commit comments