@@ -114,7 +114,13 @@ func (m cmdRootModel) View() string {
114
114
str += renderTests (cmd .tests , s )
115
115
if cmd .results != nil && m .finalized {
116
116
// render the results
117
- str += fmt .Sprintf ("\n > Command exit code: %d\n " , cmd .results .ExitCode )
117
+ for _ , test := range cmd .tests {
118
+ // for clarity, only show exit code if it's tested
119
+ if strings .Contains (test .text , "exit code" ) {
120
+ str += fmt .Sprintf ("\n > Command exit code: %d\n " , cmd .results .ExitCode )
121
+ break
122
+ }
123
+ }
118
124
str += " > Command stdout:\n \n "
119
125
sliced := strings .Split (cmd .results .Stdout , "\n " )
120
126
for _ , s := range sliced {
@@ -138,9 +144,6 @@ func prettyPrintCmd(test api.CLICommandTestCase) string {
138
144
if test .StdoutLinesGt != nil {
139
145
return fmt .Sprintf ("Expect > %d lines on stdout" , * test .StdoutLinesGt )
140
146
}
141
- if test .StdoutMatches != nil {
142
- return fmt .Sprintf ("Expect stdout to match '%s'" , * test .StdoutMatches )
143
- }
144
147
if test .StdoutContainsAll != nil {
145
148
str := "Expect stdout to contain all of:"
146
149
for _ , thing := range test .StdoutContainsAll {
0 commit comments