prep for 1.2.0 release updates

This commit is contained in:
2026-06-21 11:45:58 -07:00
parent 73191c958f
commit 032b7c39d3
286 changed files with 21116 additions and 121 deletions
+66 -8
View File
@@ -47,27 +47,27 @@ struct CLICommandTests {
// MARK: - new
@Test func newSubcommandParsed() {
#expect(CLICommand.parse(["lyrebird", "new", "MySynth"]) == .new(name: "MySynth", template: .basic, lyrebirdPath: nil))
#expect(CLICommand.parse(["lyrebird", "new", "MySynth"]) == .new(name: "MySynth", template: .basic, lyrebirdPath: nil, shoegazePath: nil))
}
@Test func newWithTemplateDemoParsed() {
#expect(CLICommand.parse(["lyrebird", "new", "MySynth", "--template", "demo"])
== .new(name: "MySynth", template: .demo, lyrebirdPath: nil))
== .new(name: "MySynth", template: .demo, lyrebirdPath: nil, shoegazePath: nil))
}
@Test func newWithTemplateUIDemoParsed() {
#expect(CLICommand.parse(["lyrebird", "new", "MySynth", "--template", "ui-demo"])
== .new(name: "MySynth", template: .uiDemo, lyrebirdPath: nil))
== .new(name: "MySynth", template: .uiDemo, lyrebirdPath: nil, shoegazePath: nil))
}
@Test func newWithTemplateNRTParsed() {
#expect(CLICommand.parse(["lyrebird", "new", "MySynth", "--template", "nrt"])
== .new(name: "MySynth", template: .nrt, lyrebirdPath: nil))
== .new(name: "MySynth", template: .nrt, lyrebirdPath: nil, shoegazePath: nil))
}
@Test func newWithUnknownTemplateFallsBackToBasic() {
#expect(CLICommand.parse(["lyrebird", "new", "MySynth", "--template", "bogus"])
== .new(name: "MySynth", template: .basic, lyrebirdPath: nil))
== .new(name: "MySynth", template: .basic, lyrebirdPath: nil, shoegazePath: nil))
}
@Test func newWithoutNameParsesToHelp() {
@@ -89,7 +89,8 @@ struct CLICommandTests {
"--lyrebird-path", "/Users/josh/Documents/LyrebirdII"
]) == .new(name: "MyPiece",
template: .basic,
lyrebirdPath: "/Users/josh/Documents/LyrebirdII"))
lyrebirdPath: "/Users/josh/Documents/LyrebirdII",
shoegazePath: nil))
}
@Test func newWithTemplateAndLyrebirdPathParsed() {
@@ -99,13 +100,70 @@ struct CLICommandTests {
"--lyrebird-path", "/abs/path"
]) == .new(name: "MyApp",
template: .macosUIXcode,
lyrebirdPath: "/abs/path"))
lyrebirdPath: "/abs/path",
shoegazePath: nil))
}
@Test func newWithoutLyrebirdPathReportsNil() {
#expect(CLICommand.parse([
"lyrebird", "new", "MyPiece"
]) == .new(name: "MyPiece", template: .basic, lyrebirdPath: nil))
]) == .new(name: "MyPiece", template: .basic, lyrebirdPath: nil, shoegazePath: nil))
}
// MARK: - shoegaze template
@Test func newWithTemplateShoegaze() {
let cmd: CLICommand = CLICommand.parse(["lyrebird", "new", "MyRig", "--template", "shoegaze"])
#expect(cmd == .new(name: "MyRig", template: .shoegaze, lyrebirdPath: nil, shoegazePath: nil))
}
@Test func newWithShoegazePathParsed() {
let cmd: CLICommand = CLICommand.parse([
"lyrebird", "new", "MyRig",
"--template", "shoegaze",
"--lyrebird-path", "/abs/Lyrebird",
"--shoegaze-path", "/abs/ShoeGaze",
])
#expect(cmd == .new(
name: "MyRig",
template: .shoegaze,
lyrebirdPath: "/abs/Lyrebird",
shoegazePath: "/abs/ShoeGaze"
))
}
@Test func newShoegazeWithoutShoegazePathHasNilShoegazePath() {
let cmd: CLICommand = CLICommand.parse([
"lyrebird", "new", "MyRig",
"--template", "shoegaze",
"--lyrebird-path", "/abs/Lyrebird",
])
#expect(cmd == .new(
name: "MyRig",
template: .shoegaze,
lyrebirdPath: "/abs/Lyrebird",
shoegazePath: nil
))
}
@Test func shoegazePathValueNotConsumedWhenFlagToken() {
// `--shoegaze-path --lyrebird-path /abs/Lyrebird` — the value slot for
// `--shoegaze-path` is `--lyrebird-path` (starts with "-") → shoegazePath = nil.
// `firstIndex(of: "--lyrebird-path")` finds the first occurrence (index 6)
// whose next token is also "--lyrebird-path" (starts with "-") → lyrebirdPath = nil too.
let args: [String] = [
"lyrebird", "new", "MyRig",
"--template", "shoegaze",
"--shoegaze-path", "--lyrebird-path",
"--lyrebird-path", "/abs/Lyrebird",
]
let cmd: CLICommand = CLICommand.parse(args)
#expect(cmd == .new(
name: "MyRig",
template: .shoegaze,
lyrebirdPath: nil,
shoegazePath: nil
))
}
// MARK: - run