Commit 8099ab2642
Verified · cmc
Layout: unified · split
Packages/FoldKit/Sources/FoldKitTestSupport/Helpers.swift +5
| @@ -488,6 +488,11 @@ public func pattern(_ name: String) -> URL { | ||
| 488 | 488 | modelsDirectory.appendingPathComponent("\(name)-cp.fold") |
| 489 | 489 | } |
| 490 | 490 | |
| 491 | /// `docs/authoring/<name>.md`. | |
| 492 | public func authoringDoc(_ name: String) -> URL { | |
| 493 | modelsDirectory.deletingLastPathComponent().appendingPathComponent("docs/authoring/\(name).md") | |
| 494 | } | |
| 495 | ||
| 491 | 496 | #if os(macOS) |
| 492 | 497 | /// Runs the built `foldlint` on `url`, returning its exit status and its standard output and |
| 493 | 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 | 119 | return Camera(eye: target + distance * eye, target: target, up: up, fieldOfView: fieldOfView) |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | @Test func theCatalogueContainsTheCup() throws { | |
| 123 | #expect(try ModelLibrary.names().contains("cup")) | |
| 122 | @Test func theCatalogueContainsTheCupAndTheBox() throws { | |
| 123 | #expect(try Set(ModelLibrary.names()) == ["cup", "box"]) | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | @Test func theCatalogueContainsTheBox() throws { | |
| 127 | #expect(try ModelLibrary.names().contains("box")) | |
| 126 | @Test func everyModelHasAnAuthoringRecord() throws { | |
| 127 | for name in try ModelLibrary.names() { | |
| 128 | #expect(FileManager.default.fileExists(atPath: authoringDoc(name).path)) | |
| 129 | } | |
| 128 | 130 | } |
| 129 | 131 | |
| 130 | 132 | @Test func theBoxRaisesItsEndsOnSolvedCurvesAndEndsStanding() throws { |