<commit_before>import XCTest
@testable import The_Blue_Alliance

class DateTBATestCase: XCTestCase {

    let calendar: Calendar = Calendar.current

    func test_isBetween_inclusive() {
        let now = Date()
        let oneHourAgo = calendar.date(byAdding: DateComponents(hour: -1), to: now)!

        XCTAssert(oneHourAgo.isBetween(date: oneHourAgo, andDate: now))
        XCTAssert(oneHourAgo.isBetween(date: now, andDate: oneHourAgo))
        XCTAssert(now.isBetween(date: now, andDate: oneHourAgo))
        XCTAssert(now.isBetween(date: oneHourAgo, andDate: now))
    }

    func test_isBetween_true() {
        let now = Date()
        let oneHourAgo = calendar.date(byAdding: DateComponents(hour: -1), to: now)!
        let halfHourAgo = calendar.date(byAdding: DateComponents(minute: -30), to: now)!

        XCTAssert(halfHourAgo.isBetween(date: oneHourAgo, andDate: now))
        XCTAssert(halfHourAgo.isBetween(date: now, andDate: oneHourAgo))
    }

    func test_isBetween_false() {
        let now = Date()
        let oneHourAgo = calendar.date(byAdding: DateComponents(hour: -1), to: now)!
        let epoch = Date(timeIntervalSince1970: 0)

        XCTAssertFalse(epoch.isBetween(date: oneHourAgo, andDate: now))
        XCTAssertFalse(epoch.isBetween(date: now, andDate: oneHourAgo))
    }

    func test_endOfDay() {
        let calendar = Calendar.current
        let today = calendar.date(bySettingHour: 0, minute: 0, second: 0, of: Date())!
        let tomorrow = calendar.date(byAdding: DateComponents(day: 1), to: today)!
        XCTAssertEqual(today.endOfDay(), calendar.date(byAdding: DateComponents(second: -1), to: tomorrow))
    }

    func test_next() {
        let calendar = Calendar.current
        let monday = calendar.date(from: DateComponents(weekday: Weekday.Monday.rawValue))!
        let wednesday = calendar.date(byAdding: DateComponents(day: 2), to: monday)!
        XCTAssertEqual(monday.next(.Wednesday), wednesday)
    }

    func test_next_exclusive() {
        let monday = Calendar.current.date(from: DateComponents(weekday: 2))!
        XCTAssertNotEqual(monday.next(.Monday), monday)
    }

}<commit_msg>Fix test_next test<commit_after>import XCTest
@testable import The_Blue_Alliance

class DateTBATestCase: XCTestCase {

    let calendar: Calendar = Calendar.current

    func test_isBetween_inclusive() {
        let now = Date()
        let oneHourAgo = calendar.date(byAdding: DateComponents(hour: -1), to: now)!

        XCTAssert(oneHourAgo.isBetween(date: oneHourAgo, andDate: now))
        XCTAssert(oneHourAgo.isBetween(date: now, andDate: oneHourAgo))
        XCTAssert(now.isBetween(date: now, andDate: oneHourAgo))
        XCTAssert(now.isBetween(date: oneHourAgo, andDate: now))
    }

    func test_isBetween_true() {
        let now = Date()
        let oneHourAgo = calendar.date(byAdding: DateComponents(hour: -1), to: now)!
        let halfHourAgo = calendar.date(byAdding: DateComponents(minute: -30), to: now)!

        XCTAssert(halfHourAgo.isBetween(date: oneHourAgo, andDate: now))
        XCTAssert(halfHourAgo.isBetween(date: now, andDate: oneHourAgo))
    }

    func test_isBetween_false() {
        let now = Date()
        let oneHourAgo = calendar.date(byAdding: DateComponents(hour: -1), to: now)!
        let epoch = Date(timeIntervalSince1970: 0)

        XCTAssertFalse(epoch.isBetween(date: oneHourAgo, andDate: now))
        XCTAssertFalse(epoch.isBetween(date: now, andDate: oneHourAgo))
    }

    func test_endOfDay() {
        let calendar = Calendar.current
        let today = calendar.date(bySettingHour: 0, minute: 0, second: 0, of: Date())!
        let tomorrow = calendar.date(byAdding: DateComponents(day: 1), to: today)!
        XCTAssertEqual(today.endOfDay(), calendar.date(byAdding: DateComponents(second: -1), to: tomorrow))
    }

    func test_next() {
        let calendar = Calendar.current
        let monday = calendar.date(from: DateComponents(weekday: Weekday.Monday.rawValue, weekdayOrdinal: 1))!
        let wednesday = calendar.date(byAdding: DateComponents(day: 2), to: monday)!
        XCTAssertEqual(monday.next(.Wednesday), wednesday)
        print(monday.next(.Wednesday))
    }

    func test_next_exclusive() {
        let monday = Calendar.current.date(from: DateComponents(weekday: 2))!
        XCTAssertNotEqual(monday.next(.Monday), monday)
    }

}
{'fraction_non_alphanumeric': 0.11606122915238748, 'fraction_numerical': 0.007996344528215673, 'mean_word_length': 3.4673469387755103, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '406327', 'n_tokens_mistral': 1543, 'n_tokens_neox': 1421, 'n_words': 299}