-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feat: 2.0.0 μ€λΉμμ
- Loading branch information
Showing
32 changed files
with
771 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 79 additions & 2 deletions
81
Projects/Feature/FeatureContentCardTests/Sources/FeatureContentCardTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,87 @@ | ||
import ComposableArchitecture | ||
import XCTest | ||
import Domain | ||
import CoreKit | ||
|
||
@testable import FeatureContentCard | ||
|
||
final class FeatureContentCardTests: XCTestCase { | ||
func test() { | ||
final class SendTests: XCTestCase { | ||
|
||
func test_primeTest() async { | ||
let count = 10 | ||
var sharedAverage: CFAbsoluteTime = 0.0 | ||
for _ in 0..<count { | ||
await test_shared_λ©μλ_μ μ©(&sharedAverage) | ||
} | ||
|
||
var noSharedAverage: CFAbsoluteTime = 0.0 | ||
for _ in 0..<count { | ||
await test_shared_λ©μλ_λ―Έμ μ©(&noSharedAverage) | ||
} | ||
|
||
print( | ||
"shared_λ©μλ_μ μ© \(count)λ² ν μ€νΈ νκ· μμμκ°", | ||
sharedAverage / CFAbsoluteTime(count) | ||
) | ||
print( | ||
"shared_λ©μλ_λ―Έμ μ© \(count)λ² ν μ€νΈ νκ· μμμκ°", | ||
noSharedAverage / CFAbsoluteTime(count) | ||
) | ||
} | ||
|
||
@MainActor | ||
func test_shared_λ©μλ_μ μ©(_ average: inout CFAbsoluteTime) async { | ||
let store = TestStore(initialState: ContentCardFeature.State( | ||
content: ContentBaseResponse.mock(id: 0).toDomain() | ||
)) { | ||
ContentCardFeature()._printChanges(.actionLabels) | ||
} withDependencies: { | ||
$0[ContentClient.self] = .testValue | ||
let parseOGImageURL: @Sendable ( | ||
_ url: URL | ||
) async throws -> String? = { _ in | ||
"https://i.ytimg.com/vi/wtSwdGJzQCQ/maxresdefault.jpg" | ||
} | ||
|
||
$0[SwiftSoupClient.self].parseOGImageURL = parseOGImageURL | ||
} | ||
|
||
let start = CFAbsoluteTimeGetCurrent() | ||
await store.send(.view(.λ©νλ°μ΄ν°_μ‘°ν)) | ||
await store.receive(\.inner.λ©νλ°μ΄ν°_μ‘°ν_μν_λ°μ) { | ||
$0.content.thumbNail = "https://i.ytimg.com/vi/wtSwdGJzQCQ/maxresdefault.jpg" | ||
} | ||
let end = CFAbsoluteTimeGetCurrent() | ||
average += end - start | ||
} | ||
|
||
@MainActor | ||
func test_shared_λ©μλ_λ―Έμ μ©(_ average: inout CFAbsoluteTime) async { | ||
let store = TestStore(initialState: LegacyContentCardFeature.State( | ||
content: ContentBaseResponse.mock(id: 0).toDomain() | ||
)) { | ||
LegacyContentCardFeature()._printChanges(.actionLabels) | ||
} withDependencies: { | ||
$0[ContentClient.self] = .testValue | ||
let parseOGImageURL: @Sendable ( | ||
_ url: URL | ||
) async throws -> String? = { _ in | ||
"https://i.ytimg.com/vi/wtSwdGJzQCQ/maxresdefault.jpg" | ||
} | ||
|
||
$0[SwiftSoupClient.self].parseOGImageURL = parseOGImageURL | ||
} | ||
|
||
let start = CFAbsoluteTimeGetCurrent() | ||
await store.send(.view(.λ©νλ°μ΄ν°_μ‘°ν)) | ||
await store.receive(\.async.λ©νλ°μ΄ν°_μ‘°ν_μν) | ||
await store.receive(\.inner.λ©νλ°μ΄ν°_μ‘°ν_μν_λ°μ) { | ||
$0.content.thumbNail = "https://i.ytimg.com/vi/wtSwdGJzQCQ/maxresdefault.jpg" | ||
} | ||
await store.receive(\.async.μΈλ€μΌ_μμ _API) | ||
let end = CFAbsoluteTimeGetCurrent() | ||
average += end - start | ||
} | ||
} | ||
|
||
|
Oops, something went wrong.