Skip to content

Commit bbe3173

Browse files
mbrandonwawaltzforvenus
authored andcommitted
Run swift-format
1 parent b9adfa1 commit bbe3173

File tree

2 files changed

+66
-66
lines changed

2 files changed

+66
-66
lines changed

Sources/InlineSnapshotTesting/AssertInlineSnapshot.swift

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ import Foundation
167167
let message = message()
168168
var failureMessage = """
169169
\(message.isEmpty ? "Snapshot did not match. Difference: …" : message)
170-
170+
171171
\(difference.indenting(by: 2))
172172
"""
173173

@@ -362,24 +362,24 @@ public struct InlineSnapshotSyntaxDescriptor: Hashable {
362362
}
363363
}
364364

365-
@_spi(Internals) public struct File: Hashable {
366-
public let path: StaticString
367-
public static func == (lhs: Self, rhs: Self) -> Bool {
365+
@_spi(Internals) public struct File: Hashable {
366+
public let path: StaticString
367+
public static func == (lhs: Self, rhs: Self) -> Bool {
368368
"\(lhs.path)" == "\(rhs.path)"
369369
}
370-
public func hash(into hasher: inout Hasher) {
370+
public func hash(into hasher: inout Hasher) {
371371
hasher.combine("\(self.path)")
372372
}
373373
}
374374

375-
@_spi(Internals) public struct InlineSnapshot: Hashable {
376-
public var expected: String?
377-
public var actual: String?
378-
public var wasRecording: Bool
379-
public var syntaxDescriptor: InlineSnapshotSyntaxDescriptor
380-
public var function: String
381-
public var line: UInt
382-
public var column: UInt
375+
@_spi(Internals) public struct InlineSnapshot: Hashable {
376+
public var expected: String?
377+
public var actual: String?
378+
public var wasRecording: Bool
379+
public var syntaxDescriptor: InlineSnapshotSyntaxDescriptor
380+
public var function: String
381+
public var line: UInt
382+
public var column: UInt
383383
}
384384

385385
@_spi(Internals) public var inlineSnapshotState: [File: [InlineSnapshot]] = [:]

Tests/InlineSnapshotTestingTests/InlineSnapshotTestingTests.swift

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -287,68 +287,68 @@ final class InlineSnapshotTestingTests: XCTestCase {
287287
}
288288
}
289289

290-
#if canImport(Darwin)
291-
func testRecordFailed_IncorrectExpectation() throws {
292-
let initialInlineSnapshotState = inlineSnapshotState
293-
defer { inlineSnapshotState = initialInlineSnapshotState }
294-
295-
XCTExpectFailure {
296-
withSnapshotTesting(record: .failed) {
297-
assertInlineSnapshot(of: 42, as: .json) {
298-
"""
299-
4
300-
"""
290+
#if canImport(Darwin)
291+
func testRecordFailed_IncorrectExpectation() throws {
292+
let initialInlineSnapshotState = inlineSnapshotState
293+
defer { inlineSnapshotState = initialInlineSnapshotState }
294+
295+
XCTExpectFailure {
296+
withSnapshotTesting(record: .failed) {
297+
assertInlineSnapshot(of: 42, as: .json) {
298+
"""
299+
4
300+
"""
301+
}
301302
}
303+
} issueMatcher: {
304+
$0.compactDescription == """
305+
failed - Snapshot did not match. Difference: …
306+
307+
@@ −1,1 +1,1 @@
308+
−4
309+
+42
310+
311+
A new snapshot was automatically recorded.
312+
"""
302313
}
303-
} issueMatcher: {
304-
$0.compactDescription == """
305-
failed - Snapshot did not match. Difference: …
306-
307-
@@ −1,1 +1,1 @@
308-
−4
309-
+42
310-
311-
A new snapshot was automatically recorded.
312-
"""
313-
}
314314

315-
XCTAssertEqual(inlineSnapshotState.count, 1)
316-
XCTAssertEqual(
317-
String(describing: inlineSnapshotState.keys.first!.path)
318-
.hasSuffix("InlineSnapshotTestingTests.swift"),
319-
true
320-
)
321-
}
315+
XCTAssertEqual(inlineSnapshotState.count, 1)
316+
XCTAssertEqual(
317+
String(describing: inlineSnapshotState.keys.first!.path)
318+
.hasSuffix("InlineSnapshotTestingTests.swift"),
319+
true
320+
)
321+
}
322322
#endif
323323

324-
#if canImport(Darwin)
325-
func testRecordFailed_MissingExpectation() throws {
326-
let initialInlineSnapshotState = inlineSnapshotState
327-
defer { inlineSnapshotState = initialInlineSnapshotState }
324+
#if canImport(Darwin)
325+
func testRecordFailed_MissingExpectation() throws {
326+
let initialInlineSnapshotState = inlineSnapshotState
327+
defer { inlineSnapshotState = initialInlineSnapshotState }
328328

329-
XCTExpectFailure {
330-
withSnapshotTesting(record: .failed) {
331-
assertInlineSnapshot(of: 42, as: .json)
332-
}
333-
} issueMatcher: {
334-
$0.compactDescription == """
335-
failed - Automatically recorded a new snapshot. Difference: …
329+
XCTExpectFailure {
330+
withSnapshotTesting(record: .failed) {
331+
assertInlineSnapshot(of: 42, as: .json)
332+
}
333+
} issueMatcher: {
334+
$0.compactDescription == """
335+
failed - Automatically recorded a new snapshot. Difference: …
336336
337-
@@ −1,1 +1,1 @@
338-
339-
+42
337+
@@ −1,1 +1,1 @@
338+
339+
+42
340340
341-
Re-run "testRecordFailed_MissingExpectation()" to assert against the newly-recorded snapshot.
342-
"""
343-
}
341+
Re-run "testRecordFailed_MissingExpectation()" to assert against the newly-recorded snapshot.
342+
"""
343+
}
344344

345-
XCTAssertEqual(inlineSnapshotState.count, 1)
346-
XCTAssertEqual(
347-
String(describing: inlineSnapshotState.keys.first!.path)
348-
.hasSuffix("InlineSnapshotTestingTests.swift"),
349-
true
350-
)
351-
}
345+
XCTAssertEqual(inlineSnapshotState.count, 1)
346+
XCTAssertEqual(
347+
String(describing: inlineSnapshotState.keys.first!.path)
348+
.hasSuffix("InlineSnapshotTestingTests.swift"),
349+
true
350+
)
351+
}
352352
#endif
353353
}
354354

0 commit comments

Comments
 (0)