v1.2.3 release: remove ShoeGaze CLI scaffolding (ShoeGaze now standalone)
This commit is contained in:
@@ -47,27 +47,27 @@ struct CLICommandTests {
|
||||
// MARK: - new
|
||||
|
||||
@Test func newSubcommandParsed() {
|
||||
#expect(CLICommand.parse(["lyrebird", "new", "MySynth"]) == .new(name: "MySynth", template: .basic, lyrebirdPath: nil, shoegazePath: nil))
|
||||
#expect(CLICommand.parse(["lyrebird", "new", "MySynth"]) == .new(name: "MySynth", template: .basic, lyrebirdPath: nil))
|
||||
}
|
||||
|
||||
@Test func newWithTemplateDemoParsed() {
|
||||
#expect(CLICommand.parse(["lyrebird", "new", "MySynth", "--template", "demo"])
|
||||
== .new(name: "MySynth", template: .demo, lyrebirdPath: nil, shoegazePath: nil))
|
||||
== .new(name: "MySynth", template: .demo, lyrebirdPath: nil))
|
||||
}
|
||||
|
||||
@Test func newWithTemplateUIDemoParsed() {
|
||||
#expect(CLICommand.parse(["lyrebird", "new", "MySynth", "--template", "ui-demo"])
|
||||
== .new(name: "MySynth", template: .uiDemo, lyrebirdPath: nil, shoegazePath: nil))
|
||||
== .new(name: "MySynth", template: .uiDemo, lyrebirdPath: nil))
|
||||
}
|
||||
|
||||
@Test func newWithTemplateNRTParsed() {
|
||||
#expect(CLICommand.parse(["lyrebird", "new", "MySynth", "--template", "nrt"])
|
||||
== .new(name: "MySynth", template: .nrt, lyrebirdPath: nil, shoegazePath: nil))
|
||||
== .new(name: "MySynth", template: .nrt, lyrebirdPath: nil))
|
||||
}
|
||||
|
||||
@Test func newWithUnknownTemplateFallsBackToBasic() {
|
||||
#expect(CLICommand.parse(["lyrebird", "new", "MySynth", "--template", "bogus"])
|
||||
== .new(name: "MySynth", template: .basic, lyrebirdPath: nil, shoegazePath: nil))
|
||||
== .new(name: "MySynth", template: .basic, lyrebirdPath: nil))
|
||||
}
|
||||
|
||||
@Test func newWithoutNameParsesToHelp() {
|
||||
@@ -89,8 +89,7 @@ struct CLICommandTests {
|
||||
"--lyrebird-path", "/Users/josh/Documents/LyrebirdII"
|
||||
]) == .new(name: "MyPiece",
|
||||
template: .basic,
|
||||
lyrebirdPath: "/Users/josh/Documents/LyrebirdII",
|
||||
shoegazePath: nil))
|
||||
lyrebirdPath: "/Users/josh/Documents/LyrebirdII"))
|
||||
}
|
||||
|
||||
@Test func newWithTemplateAndLyrebirdPathParsed() {
|
||||
@@ -100,70 +99,13 @@ struct CLICommandTests {
|
||||
"--lyrebird-path", "/abs/path"
|
||||
]) == .new(name: "MyApp",
|
||||
template: .macosUIXcode,
|
||||
lyrebirdPath: "/abs/path",
|
||||
shoegazePath: nil))
|
||||
lyrebirdPath: "/abs/path"))
|
||||
}
|
||||
|
||||
@Test func newWithoutLyrebirdPathReportsNil() {
|
||||
#expect(CLICommand.parse([
|
||||
"lyrebird", "new", "MyPiece"
|
||||
]) == .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
|
||||
))
|
||||
]) == .new(name: "MyPiece", template: .basic, lyrebirdPath: nil))
|
||||
}
|
||||
|
||||
// MARK: - run
|
||||
|
||||
Reference in New Issue
Block a user