Cotton code
24 lines · 1010 B · SwiftRaw
@testable import CottonUIimport CottonKitimport XCTest/// RULE: an event says when it ends in the core's words (`ends`): a clock on/// its own day closes the start's clock ("4:30 pm – 5:15 pm"), a later day/// stands on its own line ("until Sun 8 Nov"), and no `ends` changes/// nothing (package #71, 24 Oct 2026).final class EventEndsTests: XCTestCase {    func testAClockOnItsOwnDayClosesTheStart() {        XCTAssertEqual(EventEnds.clock("4:30 pm", ends: "5:15 pm"), ShellLines.line("dates", "span", ["start": "4:30 pm", "end": "5:15 pm"]))        XCTAssertNil(EventEnds.day("5:15 pm"))    }    func testALaterDayStandsOnItsOwnLine() {        XCTAssertEqual(EventEnds.clock("4:30 pm", ends: "Sun 8 Nov"), "4:30 pm")        XCTAssertEqual(EventEnds.day("Sun 8 Nov"), ShellLines.line("dates", "until", ["day": "Sun 8 Nov"]))    }    func testNoEndChangesNothing() {        XCTAssertEqual(EventEnds.clock("4:30 pm", ends: nil), "4:30 pm")        XCTAssertNil(EventEnds.day(nil))    }}