Cotton code
19 lines · 954 B · SwiftRaw
// Whose words a record's are, as `read.record` names its writer// (`RecordExtras.writer`). Every label is invented.import Foundationimport XCTest@testable import CottonUIfinal class RecordExtrasTests: XCTestCase {    /// RULE: A writer is named by the label it carries; a missing label or a writer's id ("job:synthetic", any "kind:" prefix) names nobody, never a raw id.    func testAWriterIsNamedOnlyByAReadableLabel() {        XCTAssertEqual(RecordExtras.writer("Example assistant"), "Example assistant")        XCTAssertEqual(RecordExtras.writer("  Example assistant \n"), "Example assistant")        XCTAssertNil(RecordExtras.writer(nil), "no name, no writer")        XCTAssertNil(RecordExtras.writer("  "))        XCTAssertNil(RecordExtras.writer("job:synthetic"), "a writer's id is never shown")        XCTAssertEqual(RecordExtras.writer("An example: invented"), "An example: invented", "a colon after words is not an id")    }}