Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into muukii/swift6
Browse files Browse the repository at this point in the history
  • Loading branch information
muukii committed Dec 12, 2024
2 parents 0095703 + e55c598 commit 4009d69
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CommitChecks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- uses: maxim-lobanov/[email protected]
with:
xcode-version: "15.4"
xcode-version: "16.1"
- uses: actions/checkout@v2
- name: xcbeautify
run: brew install xcbeautify
Expand Down
20 changes: 4 additions & 16 deletions Sources/VergeComparator/PackedCompare.swift
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@

@_spi(Internal)
public func areEqual<each Element: Equatable>(_ lhs: (repeat each Element), _ rhs: (repeat each Element)) -> Bool {

// https://github.com/apple/swift-evolution/blob/main/proposals/0408-pack-iteration.md

func isEqual<T: Equatable>(_ left: T, _ right: T) throws {
if left == right {
return
}

throw NotEqual()

for (left, right) in repeat (each lhs, each rhs) {
guard left == right else { return false }
}

do {
repeat try isEqual(each lhs, each rhs)
} catch {
return false
}

return true

}

7 changes: 6 additions & 1 deletion Sources/VergeComparator/TypedComparator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ extension TypedComparator {
*/
public static func equality<each T: Equatable>() -> Self where Self == AnyEqualityComparator<(repeat each T)> {
return .init { a, b in
areEqual((repeat each a), (repeat each b))

for (left, right) in repeat (each a, each b) {
guard left == right else { return false }
}
return true

}
}

Expand Down
3 changes: 0 additions & 3 deletions Tests/VergeTests/StoreReaderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ final class StoreReaderTests: XCTestCase {
let inspect = try view.inspect()

XCTAssertEqual(count, 0)

// POC
XCTAssertEqual(try inspect.vStack()[0].text().string(), "Hello")

XCTAssertEqual(try inspect.find(viewWithId: "count_1").text().string(), "0")

Expand Down

0 comments on commit 4009d69

Please sign in to comment.