expand test cases
This commit is contained in:
parent
810b9714d3
commit
0f9d8a9abd
@ -9,24 +9,36 @@ import (
|
|||||||
// Relevant PR: https://github.com/urfave/cli/pull/872
|
// Relevant PR: https://github.com/urfave/cli/pull/872
|
||||||
func TestVersionOneTwoOneRegression(t *testing.T) {
|
func TestVersionOneTwoOneRegression(t *testing.T) {
|
||||||
testData := []struct {
|
testData := []struct {
|
||||||
testCase string
|
testCase string
|
||||||
appRunInput []string
|
appRunInput []string
|
||||||
|
skipArgReorder bool
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
testCase: "with_dash_dash",
|
testCase: "with_dash_dash",
|
||||||
appRunInput: []string{"cli", "command", "--flagone", "flagvalue", "--", "docker", "image", "ls", "--no-trunc"},
|
appRunInput: []string{"cli", "command", "--flagone", "flagvalue", "--", "docker", "image", "ls", "--no-trunc"},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
testCase: "with_dash_dash_and_skip_reorder",
|
||||||
|
appRunInput: []string{"cli", "command", "--flagone", "flagvalue", "--", "docker", "image", "ls", "--no-trunc"},
|
||||||
|
skipArgReorder: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
testCase: "without_dash_dash",
|
testCase: "without_dash_dash",
|
||||||
appRunInput: []string{"cli", "command", "--flagone", "flagvalue", "docker", "image", "ls", "--no-trunc"},
|
appRunInput: []string{"cli", "command", "--flagone", "flagvalue", "docker", "image", "ls", "--no-trunc"},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
testCase: "without_dash_dash_and_skip_reorder",
|
||||||
|
appRunInput: []string{"cli", "command", "--flagone", "flagvalue", "docker", "image", "ls", "--no-trunc"},
|
||||||
|
skipArgReorder: true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
for _, test := range testData {
|
for _, test := range testData {
|
||||||
t.Run(test.testCase, func(t *testing.T) {
|
t.Run(test.testCase, func(t *testing.T) {
|
||||||
// setup
|
// setup
|
||||||
app := NewApp()
|
app := NewApp()
|
||||||
app.Commands = []Command{{
|
app.Commands = []Command{{
|
||||||
Name: "command",
|
Name: "command",
|
||||||
|
SkipArgReorder: test.skipArgReorder,
|
||||||
Flags: []Flag{
|
Flags: []Flag{
|
||||||
StringFlag{
|
StringFlag{
|
||||||
Name: "flagone",
|
Name: "flagone",
|
||||||
|
Loading…
Reference in New Issue
Block a user