15 lines
321 B
Go
15 lines
321 B
Go
package main
|
|||
|
|
|
||
|
|
import (
|
||
|
|
"bytes"
|
||
|
|
"strings"
|
||
|
|
"testing"
|
||
|
|
)
|
||
|
|
|
||
|
|
func TestRunCLIRejectsUnknownCommandWithStableCode(t *testing.T) {
|
||
|
|
var out bytes.Buffer
|
||
|
|
if code := runCLI([]string{"wat"}, &out, &out); code != 2 || !strings.Contains(out.String(), `"invalid_argument"`) {
|
||
|
|
t.Fatalf("code=%d output=%s", code, out.String())
|
||
|
|
}
|
||
|
|
}
|