(t *testing.T)
| 108 | } |
| 109 | |
| 110 | func TestUsage(t *testing.T) { |
| 111 | var b bytes.Buffer |
| 112 | rootCmd.ResetFlags() |
| 113 | rootCmd.SetOutput(&b) |
| 114 | initRootCmd() |
| 115 | |
| 116 | if err := rootCmd.ParseFlags([]string{}); err != nil { |
| 117 | t.Fatalf("exepected nil; got %v", err) |
| 118 | } |
| 119 | if err := rootCmd.Execute(); err != nil { |
| 120 | t.Fatalf("exepected nil; got %v", err) |
| 121 | } |
| 122 | if got := b.String(); got == "" { |
| 123 | t.Fatalf("expected not empty string; got %q", got) |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | func TestShowErrorOnly(t *testing.T) { |
| 128 | expErr := errors.New("error") |
nothing calls this directly
no test coverage detected