Commit 8099ab2642

8099ab264278da98f627af27947215c81e603460

parent: abaafc9ad1

Verified · cmc

cmc <hello@cleberg.net> · 2026-10-22 18:51 UTC

Pin the catalogue to the cup and the box; require an authoring record per model

Ref #7

Layout: unified · split

Packages/FoldKit/Sources/FoldKitTestSupport/Helpers.swift +5
@@ -488,6 +488,11 @@ public func pattern(_ name: String) -> URL {
488 modelsDirectory.appendingPathComponent("\(name)-cp.fold") 488 modelsDirectory.appendingPathComponent("\(name)-cp.fold")
489} 489}
490 490
491/// `docs/authoring/<name>.md`.
492public func authoringDoc(_ name: String) -> URL {
493 modelsDirectory.deletingLastPathComponent().appendingPathComponent("docs/authoring/\(name).md")
494}
495
491#if os(macOS) 496#if os(macOS)
492/// Runs the built `foldlint` on `url`, returning its exit status and its standard output and 497/// Runs the built `foldlint` on `url`, returning its exit status and its standard output and
493/// error together. The executable is beside the test bundle, which may hold this module's 498/// error together. The executable is beside the test bundle, which may hold this module's
Packages/FoldKit/Tests/ModelsTests/CatalogueTests.swift +6 −4
@@ -119,12 +119,14 @@ private func sessionCamera(_ file: FoldFile, _ step: FoldStep, aspect: Double) -
119 return Camera(eye: target + distance * eye, target: target, up: up, fieldOfView: fieldOfView) 119 return Camera(eye: target + distance * eye, target: target, up: up, fieldOfView: fieldOfView)
120} 120}
121 121
122@Test func theCatalogueContainsTheCup() throws { 122@Test func theCatalogueContainsTheCupAndTheBox() throws {
123 #expect(try ModelLibrary.names().contains("cup")) 123 #expect(try Set(ModelLibrary.names()) == ["cup", "box"])
124} 124}
125 125
126@Test func theCatalogueContainsTheBox() throws { 126@Test func everyModelHasAnAuthoringRecord() throws {
127 #expect(try ModelLibrary.names().contains("box")) 127 for name in try ModelLibrary.names() {
128 #expect(FileManager.default.fileExists(atPath: authoringDoc(name).path))
129 }
128} 130}
129 131
130@Test func theBoxRaisesItsEndsOnSolvedCurvesAndEndsStanding() throws { 132@Test func theBoxRaisesItsEndsOnSolvedCurvesAndEndsStanding() throws {