Stabilize beta release with warning cleanup and edge-case fixes

This commit is contained in:
Trey t
2026-02-22 13:18:14 -06:00
parent fddea81e36
commit ec2bbb4764
55 changed files with 712 additions and 315 deletions

View File

@@ -235,7 +235,7 @@ struct GameDAGRouterTests {
let (game1, stadium1) = makeGameAndStadium(city: "New York", date: dates[0], coord: nycCoord)
let (game2, stadium2) = makeGameAndStadium(city: "Boston", date: dates[1], coord: bostonCoord)
let (game3, stadium3) = makeGameAndStadium(city: "New York", date: dates[2], coord: nycCoord) // Same city
let (game3, _) = makeGameAndStadium(city: "New York", date: dates[2], coord: nycCoord) // Same city
// Use same stadium ID for same city
let nyStadium = stadium1

View File

@@ -73,7 +73,6 @@ struct Bug2_InfiniteLoopTests {
@Test("calculateRestDays does not hang for normal multi-day stop")
func calculateRestDays_normalMultiDay_terminates() {
let calendar = TestClock.calendar
let arrival = TestFixtures.date(year: 2026, month: 6, day: 10, hour: 12)
let departure = TestFixtures.date(year: 2026, month: 6, day: 14, hour: 12)

View File

@@ -257,6 +257,17 @@ struct RouteFiltersTests {
#expect(result.count == 1)
}
@Test("filterByDateRange: inverted range bounds are normalized")
func filterByDateRange_invertedBounds_normalized() {
let dayAfterTomorrow = calendar.date(byAdding: .day, value: 2, to: today)!
let trip = makeTrip(startDate: tomorrow, endDate: dayAfterTomorrow)
// Callers can accidentally pass (end, start); filter should still behave as expected.
let result = RouteFilters.filterByDateRange([trip], start: nextWeek, end: today)
#expect(result.count == 1)
}
// MARK: - Specification Tests: filterByStatus
@Test("filterByStatus: returns matching status only")
@@ -369,15 +380,24 @@ struct RouteFiltersTests {
// MARK: - Edge Case Tests
@Test("Edge: city names are case-sensitive")
func edge_cityNamesCaseSensitive() {
@Test("Edge: city names are normalized case-insensitively")
func edge_cityNamesCaseInsensitive() {
let option = makeOption(stops: [
makeStop(city: "New York", date: today),
makeStop(city: "new york", date: tomorrow) // Different case
])
// Currently case-sensitive, so these are different cities
#expect(!RouteFilters.hasRepeatCityViolation(option))
#expect(RouteFilters.hasRepeatCityViolation(option))
}
@Test("Edge: city names are normalized for punctuation and spacing")
func edge_cityNamesNormalizedForPunctuationAndSpacing() {
let option = makeOption(stops: [
makeStop(city: "St. Louis", date: today),
makeStop(city: "st louis", date: tomorrow)
])
#expect(RouteFilters.hasRepeatCityViolation(option))
}
@Test("Edge: very long trip with many stops")