aerospace fork
Something went wrong. Try again.
880 B · 25 lines
Swift
at main
1234567891011121314151617181920212223242526@testable import AppBundleimport Commonimport XCTest
@MainActorfinal class ModeCommandTest: XCTestCase { override func setUp() async throws { setUpWorkspacesForTests() }
func testParse() { testParseSingleCommandSucc("mode main", ModeCmdArgs(rawArgs: []).copy(\.targetMode, .initialized("main"))) assertEquals(parseCommand("mode").errorOrNil, "ERROR: Argument '<binding-mode>' is mandatory") }
func testParseDashDash() { testParseSingleCommandSucc( "mode -- main", ModeCmdArgs(rawArgs: []).copy(\.targetMode, .initialized("main")), ) testParseSingleCommandSucc( "mode -- --foo", ModeCmdArgs(rawArgs: []).copy(\.targetMode, .initialized("--foo")), ) assertEquals(parseCommand("mode --").errorOrNil, "ERROR: Argument '<binding-mode>' is mandatory") }}