(t *testing.T)
| 11 | ) |
| 12 | |
| 13 | func TestIsProdMode(t *testing.T) { |
| 14 | before := App.RunMode |
| 15 | defer func() { |
| 16 | App.RunMode = before |
| 17 | }() |
| 18 | |
| 19 | tests := []struct { |
| 20 | mode string |
| 21 | want bool |
| 22 | }{ |
| 23 | {mode: "dev", want: false}, |
| 24 | {mode: "test", want: false}, |
| 25 | |
| 26 | {mode: "prod", want: true}, |
| 27 | {mode: "Prod", want: true}, |
| 28 | {mode: "PROD", want: true}, |
| 29 | } |
| 30 | for _, test := range tests { |
| 31 | t.Run("", func(t *testing.T) { |
| 32 | App.RunMode = test.mode |
| 33 | assert.Equal(t, test.want, IsProdMode()) |
| 34 | }) |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | func TestWorkDirHelper(_ *testing.T) { |
| 39 | if !testutil.WantHelperProcess() { |
nothing calls this directly
no test coverage detected