From 0f9d8a9abdbb755069f45e89d90b3e06499302c2 Mon Sep 17 00:00:00 2001 From: Lynn Cyrin Date: Sun, 25 Aug 2019 11:14:20 -0700 Subject: [PATCH] expand test cases --- app_regression_test.go | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/app_regression_test.go b/app_regression_test.go index 2299df5..3c8681b 100644 --- a/app_regression_test.go +++ b/app_regression_test.go @@ -9,24 +9,36 @@ import ( // Relevant PR: https://github.com/urfave/cli/pull/872 func TestVersionOneTwoOneRegression(t *testing.T) { testData := []struct { - testCase string - appRunInput []string + testCase string + appRunInput []string + skipArgReorder bool }{ { testCase: "with_dash_dash", 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", 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 { t.Run(test.testCase, func(t *testing.T) { // setup app := NewApp() app.Commands = []Command{{ - Name: "command", + Name: "command", + SkipArgReorder: test.skipArgReorder, Flags: []Flag{ StringFlag{ Name: "flagone",