Cotton code
16 lines · 805 B · SwiftRaw
@testable import CottonFaces@testable import CottonUIimport XCTest/// RULE: an artifact titled with its own address reads by the address's last part, its host apart; any other title stands as it is (real-data walk, 23 Oct 2026: URLs as titles).final class ArtifactTitleTests: XCTestCase {    func testAnAddressReadsByItsLastPart() {        XCTAssertEqual(ArtifactTitle("https://claude.ai/public/artifacts/trip-planner.html"),                       ArtifactTitle(words: "Trip planner", host: "claude.ai"))        XCTAssertEqual(ArtifactTitle("https://invented.example/"), ArtifactTitle(words: "invented.example", host: nil))    }    func testATitleStands() {        XCTAssertEqual(ArtifactTitle("Invented reading tracker"), ArtifactTitle(words: "Invented reading tracker", host: nil))    }}