native macOS codings agent orchestrator prowl.onev.cat
Something went wrong. Try again.
1.3 kB · 48 lines
Swift
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849import Testing
@testable import supacode
struct WorktreeLoadingInfoTests { @Test func statusSubtitleUsesLatestFiveOutputLines() { let info = WorktreeLoadingInfo( name: "feature", repositoryName: "Prowl", state: .creating, statusTitle: "Creating worktree", statusDetail: "Preparing worktree", statusCommand: "git worktree add", statusLines: ["one", "two", "three", "four", "five", "six"] )
#expect(info.statusSubtitle == "two\nthree\nfour\nfive\nsix") }
@Test func statusSubtitleFallsBackToProgressDetailBeforeTitle() { let info = WorktreeLoadingInfo( name: "feature", repositoryName: "Prowl", state: .creating, statusTitle: "Creating worktree", statusDetail: "Preparing worktree", statusCommand: nil, statusLines: [] )
#expect(info.statusSubtitle == "Preparing worktree") }
@Test func removingPlainFolderUsesFolderNounWithoutRepositorySuffix() { let info = WorktreeLoadingInfo( name: "Documents", repositoryName: "Documents", state: .removing, isFolder: true, statusTitle: nil, statusDetail: nil, statusCommand: nil, statusLines: [] )
#expect(info.statusSubtitle == "Removing folder...") }}