Skip to content

Commit

Permalink
Run swift-format
Browse files Browse the repository at this point in the history
  • Loading branch information
stephencelis authored and github-actions[bot] committed Mar 12, 2024
1 parent f01efb2 commit 2a7c711
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 23 deletions.
41 changes: 21 additions & 20 deletions Sources/CustomDump/Diff.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,24 +123,26 @@ public func diff<T>(_ lhs: T, _ rhs: T, format: DiffFormat = .default) -> String
!(lhs is _CustomDiffObject),
!(rhs is _CustomDiffObject)
{
let lhsDump = _customDump(
lhs,
name: lhsName,
nameSuffix: nameSuffix,
indent: indent,
isRoot: false,
maxDepth: 0,
tracker: &tracker
) + separator
let rhsDump = _customDump(
rhs,
name: rhsName,
nameSuffix: nameSuffix,
indent: indent,
isRoot: false,
maxDepth: 0,
tracker: &tracker
) + separator
let lhsDump =
_customDump(
lhs,
name: lhsName,
nameSuffix: nameSuffix,
indent: indent,
isRoot: false,
maxDepth: 0,
tracker: &tracker
) + separator
let rhsDump =
_customDump(
rhs,
name: rhsName,
nameSuffix: nameSuffix,
indent: indent,
isRoot: false,
maxDepth: 0,
tracker: &tracker
) + separator
if lhsDump == rhsDump {
print(
"// Not equal but no difference detected:"
Expand Down Expand Up @@ -525,8 +527,7 @@ public func diff<T>(_ lhs: T, _ rhs: T, format: DiffFormat = .default) -> String
areInIncreasingOrder: lhsMirror.subjectType is _UnorderedCollection.Type
? {
let (lhsValue, rhsValue): (Any, Any)
if
let lhs = $0.value as? (key: AnyHashable, value: Any),
if let lhs = $0.value as? (key: AnyHashable, value: Any),
let rhs = $1.value as? (key: AnyHashable, value: Any)
{
lhsValue = lhs.key.base
Expand Down
2 changes: 1 addition & 1 deletion Tests/CustomDumpTests/DiffTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ final class DiffTests: XCTestCase {
let u2 = User(id: 2, name: "Blob Jr.")
let u3 = User(id: 3, name: "Blob Sr.")

struct Three { let u1: User, u2: User, u3: User}
struct Three { let u1: User, u2: User, u3: User }

XCTAssertNoDifference(
diff(
Expand Down
4 changes: 2 additions & 2 deletions Tests/CustomDumpTests/DumpTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ final class DumpTests: XCTestCase {
func testKeyPath() {
// NB: While this should run on >=5.9, it currently crashes CI on Xcode 15.2
#if swift(>=5.10) && (os(iOS) || os(macOS) || os(tvOS) || os(watchOS))
var dump = ""
var dump = ""
if #available(macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4, *) {
dump = ""
customDump(\UserClass.name, to: &dump)
Expand Down Expand Up @@ -1390,7 +1390,7 @@ final class DumpTests: XCTestCase {
let objs1 = DiffableObjects(obj1: obj1, obj2: obj1)
let objs2 = DiffableObjects(obj1: obj2, obj2: obj2)
let objsParent = DiffableObjectsParent(objs1: objs1, objs2: objs2)

XCTAssertNoDifference(
String(customDumping: objsParent),
"""
Expand Down

0 comments on commit 2a7c711

Please sign in to comment.