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 Jul 22, 2024
1 parent e01dfcc commit 5201882
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ let package = Package(
.target(
name: "DependenciesTestObserver",
dependencies: [
.product(name: "IssueReporting", package: "swift-issue-reporting"),
.product(name: "IssueReporting", package: "swift-issue-reporting")
]
),
.target(
Expand Down Expand Up @@ -82,7 +82,7 @@ let package = Package(

#if !os(WASI)
package.dependencies.append(contentsOf: [
.package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.2.0"),
.package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.2.0")
])
package.targets.append(contentsOf: [
.testTarget(
Expand Down
2 changes: 1 addition & 1 deletion Sources/Dependencies/Dependency.swift
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ extension Dependency {
) where Key.Value == Value {
self.init(
\DependencyValues.[
key: HashableType<Key>(fileID: fileID, filePath: filePath, line: line, column: column)
key:HashableType<Key>(fileID: fileID, filePath: filePath, line: line, column: column)
],
fileID: fileID,
filePath: filePath,
Expand Down
6 changes: 3 additions & 3 deletions Sources/Dependencies/DependencyValues.swift
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,9 @@ public final class CachedValues: @unchecked Sendable {
)

var argument: String {
"\(function)" == "subscript(key:)"
? "\(typeName(Key.self)).self"
: "\\.\(function)"
"\(function)" == "subscript(key:)"
? "\(typeName(Key.self)).self"
: "\\.\(function)"
}

reportIssue(
Expand Down
52 changes: 26 additions & 26 deletions Tests/DependenciesTests/SwiftTestingTests.swift
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
#if canImport(Testing)
import Dependencies
import Testing
import Dependencies
import Testing

struct SwiftTestingTests {
@Test
func cachePollution1() async {
await withDependencies {
$0 = DependencyValues()
} operation: {
@Dependency(\.cachedDependency) var cachedDependency: CachedDependency
let value = await cachedDependency.increment()
#expect(value == 1)
struct SwiftTestingTests {
@Test
func cachePollution1() async {
await withDependencies {
$0 = DependencyValues()
} operation: {
@Dependency(\.cachedDependency) var cachedDependency: CachedDependency
let value = await cachedDependency.increment()
#expect(value == 1)
}
}
}

@Test
func cachePollution2() async {
await withDependencies {
$0 = DependencyValues()
} operation: {
@Dependency(\.cachedDependency) var cachedDependency: CachedDependency
let value = await cachedDependency.increment()
// NB: Wasm has different behavior here.
#if os(WASI)
#expect(value == 2)
#else
#expect(value == 1)
#endif
@Test
func cachePollution2() async {
await withDependencies {
$0 = DependencyValues()
} operation: {
@Dependency(\.cachedDependency) var cachedDependency: CachedDependency
let value = await cachedDependency.increment()
// NB: Wasm has different behavior here.
#if os(WASI)
#expect(value == 2)
#else
#expect(value == 1)
#endif
}
}
}
}
#endif

0 comments on commit 5201882

Please sign in to comment.