From 066db98b8b7c34decae3845e7211c40d5578ed09 Mon Sep 17 00:00:00 2001 From: Guillaume Tardif Date: Wed, 30 Sep 2020 11:42:06 +0200 Subject: [PATCH] Minor: fix test shorthand for `--debug` : `-D` and add tests case for mixing `-D` and `compose -f xxx up` Signed-off-by: Guillaume Tardif --- metrics/metrics_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/metrics/metrics_test.go b/metrics/metrics_test.go index ef91dfd2e..cb79f9a57 100644 --- a/metrics/metrics_test.go +++ b/metrics/metrics_test.go @@ -25,7 +25,7 @@ import ( func TestFlag(t *testing.T) { root := &cobra.Command{} - root.PersistentFlags().BoolP("debug", "d", false, "debug") + root.PersistentFlags().BoolP("debug", "D", false, "debug") root.PersistentFlags().String("str", "str", "str") testCases := []struct { @@ -40,7 +40,7 @@ func TestFlag(t *testing.T) { }, { name: "with short flags", - args: []string{"-d", "run"}, + args: []string{"-D", "run"}, expected: "run", }, { @@ -143,6 +143,11 @@ func TestFlag(t *testing.T) { args: []string{"compose", "-f", "titi.yaml", "up"}, expected: "compose up", }, + { + name: "-D compose -f xxx up", + args: []string{"--debug", "compose", "-f", "titi.yaml", "up"}, + expected: "compose up", + }, } for _, testCase := range testCases {