Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
taino committed May 15, 2017
1 parent f24b22d commit 878f1af
Showing 1 changed file with 16 additions and 21 deletions.
37 changes: 16 additions & 21 deletions Tests/CommandCougarTests/CommandCougarTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,41 +43,25 @@ class CommandCougarTests: XCTestCase {

}

func testIndexing() {
let swift = Command.swift
XCTAssert(swift["package"]?.options["v"] != nil)
XCTAssert(swift["package update"]?.options["repin"] != nil)
XCTAssert(swift["package edit"]?.maxParameterCount == 1)
}

func echo(evaluation: Command.Evaluation) throws {
print(
"\(evaluation.name) evaluated with " +
" options: \(evaluation.options) " +
" and parameters \(evaluation.parameters)"
)
}

func testMarkdownExample() {
func echo(evaluation: Command.Evaluation) throws {
print(
"\(evaluation.name) evaluated with " +
"options: \(evaluation.options) " +
"and parameters \(evaluation.parameters)"
)
}

let swiftCommand =

let swiftCommand =
Command.Description(
name: "swift",
overview: "Swift Program",
callback: echo,
callback: nil,
options: [],
subCommands: [
Command.Description(
name: "package",
overview: "Perform operations on Swift packages",
callback: echo,
callback: nil,
options: [
Option.Description(
flag: .both(short: "v", long: "verbose"),
Expand All @@ -90,7 +74,7 @@ class CommandCougarTests: XCTestCase {
Command.Description(
name: "update",
overview: "Update package dependencies",
callback: echo,
callback: nil,
options: [
Option.Description(
flag: .long("repin"),
Expand All @@ -99,6 +83,17 @@ class CommandCougarTests: XCTestCase {
subCommands: [])
])
])

func testIndexing() {
let swift = swiftCommand
XCTAssert(swift["package"]?.options["v"] != nil)
XCTAssert(swift["package update"]?.options["repin"] != nil)
//XCTAssert(swift["package edit"]?.maxParameterCount == 1)
}



func testMarkdownExample() {

// args normally is CommandLine.arguments
do {
Expand Down

0 comments on commit 878f1af

Please sign in to comment.