Skip to content

Commit

Permalink
Run swift-format
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrandonw authored and github-actions[bot] committed Oct 8, 2024
1 parent fb739f2 commit 42a0861
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
5 changes: 2 additions & 3 deletions Sources/SnapshotTesting/AssertSnapshot.swift
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,9 @@ public func verifySnapshot<Value, Format>(

if !attachments.isEmpty {
#if !os(Linux) && !os(Windows)
if
ProcessInfo.processInfo.environment.keys.contains("__XCODE_BUILT_PRODUCTS_DIR_PATHS"),
if ProcessInfo.processInfo.environment.keys.contains("__XCODE_BUILT_PRODUCTS_DIR_PATHS"),
!isSwiftTesting
{
{
XCTContext.runActivity(named: "Attached Failure Diff") { activity in
attachments.forEach {
activity.add($0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"""
â–¿ 2 elements
- "Hello"
"""
}
} matching: { issue in
Expand Down
39 changes: 20 additions & 19 deletions Tests/SnapshotTestingTests/SwiftTestingTests.swift
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
#if compiler(>=6) && canImport(Testing)
import Testing
import SnapshotTesting
import Testing
import SnapshotTesting

@Suite(.snapshots(diffTool: "ksdiff"))
struct SwiftTestingTests {
@Test func testSnapshot() {
assertSnapshot(of: ["Hello", "World"], as: .dump)
}
@Suite(.snapshots(diffTool: "ksdiff"))
struct SwiftTestingTests {
@Test func testSnapshot() {
assertSnapshot(of: ["Hello", "World"], as: .dump)
}

@Test func testSnapshotFailure() {
withKnownIssue {
assertSnapshot(of: ["Goodbye", "World"], as: .dump)
} matching: { issue in
issue.description.hasSuffix("""
@@ −1,4 +1,4 @@
 ▿ 2 elements
− - "Hello"
+ - "Goodbye"
  - "World"
""")
@Test func testSnapshotFailure() {
withKnownIssue {
assertSnapshot(of: ["Goodbye", "World"], as: .dump)
} matching: { issue in
issue.description.hasSuffix(
"""
@@ −1,4 +1,4 @@
 ▿ 2 elements
− - "Hello"
+ - "Goodbye"
  - "World"
""")
}
}
}
}
#endif

0 comments on commit 42a0861

Please sign in to comment.