From 74cd3bc3fe03403d513c2084c48f7cbdd1d5bba6 Mon Sep 17 00:00:00 2001 From: "[[ BOT ]] Lynn Cyrin" Date: Thu, 22 Aug 2019 21:29:33 -0700 Subject: [PATCH] cleanup tests --- app_test.go | 43 ++++++++++++++----------------------------- 1 file changed, 14 insertions(+), 29 deletions(-) diff --git a/app_test.go b/app_test.go index 84329ee..37950f8 100644 --- a/app_test.go +++ b/app_test.go @@ -1187,37 +1187,22 @@ func TestRequiredFlagAppRunBehavior(t *testing.T) { } } -// func TestAppRunPassThroughRegression(t *testing.T) { -// tdata := []struct { -// testCase string -// appRunInput []string -// appCommands []Command -// }{ -// { -// testCase: "test_case", -// appRunInput: []string{"myCLI", "myCommand", "--someFlag", "someInput", "docker", "run", "--rm", "ubuntu", "bash"}, -// appCommands: []Command{{ -// Name: "myCommand", -// Flags: []Flag{StringFlag{Name: "someFlag"}}, -// }}, -// }, -// } -// for _, test := range tdata { -// t.Run(test.testCase, func(t *testing.T) { -// // setup -// app := NewApp() -// app.Commands = test.appCommands +func TestRegression(t *testing.T) { + // setup + app := NewApp() + app.Commands = []Command{{ + Name: "myCommand", + Flags: []Flag{StringFlag{Name: "someFlag"}}, + }} -// // logic under test -// err := app.Run(test.appRunInput) + // logic under test + err := app.Run([]string{"myCLI", "myCommand", "--someFlag", "someInput", "docker", "run", "--rm", "ubuntu", "bash"}) -// // assertions -// if err != nil { -// t.Errorf("did not expected an error, but there was one: %s", err) -// } -// }) -// } -// } + // assertions + if err != nil { + t.Errorf("did not expected an error, but there was one: %s", err) + } +} func TestAppHelpPrinter(t *testing.T) { oldPrinter := HelpPrinter