Skip to content

Commit 030035b

Browse files
authored
Fix cyclical loop in tests (#688)
1 parent 8e6158f commit 030035b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Loop/Managers/Store Protocols/CarbStoreProtocol.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ protocol CarbStoreProtocol: AnyObject {
2222
}
2323

2424
extension CarbStoreProtocol {
25-
func getCarbEntries(start: Date?, end: Date?, dateAscending: Bool = true, with favoriteFoodID: String? = nil) async throws -> [StoredCarbEntry] {
26-
try await getCarbEntries(start: start, end: end, dateAscending: dateAscending, with: favoriteFoodID)
25+
func getCarbEntries(start: Date?, end: Date?) async throws -> [StoredCarbEntry] {
26+
try await getCarbEntries(start: start, end: end, dateAscending: true, with: nil)
2727
}
2828
}
2929

LoopTests/Mock Stores/MockCarbStore.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class MockCarbStore: CarbStoreProtocol {
1616

1717
var carbHistory: [StoredCarbEntry] = []
1818

19-
func getCarbEntries(start: Date?, end: Date?) async throws -> [StoredCarbEntry] {
19+
func getCarbEntries(start: Date?, end: Date?, dateAscending: Bool, with favoriteFoodID: String?) async throws -> [StoredCarbEntry] {
2020
return carbHistory.filterDateRange(start, end)
2121
}
2222

0 commit comments

Comments
 (0)