fix panic in fs_reader

This commit is contained in:
textaligncenter
2024-08-03 16:44:45 +00:00
parent d407abb50f
commit d8ea178e69
3 changed files with 15 additions and 0 deletions

View File

@@ -34,6 +34,11 @@ func TestCommandReaderInvalid(t *testing.T) {
test.Assert(t, err != nil, "missing error")
}
func TestCommandReaderEmptyArgs(t *testing.T) {
_, err := fs.NewCommandReader(context.TODO(), []string{}, io.Discard)
test.Assert(t, err != nil, "missing error")
}
func TestCommandReaderOutput(t *testing.T) {
reader, err := fs.NewCommandReader(context.TODO(), []string{"echo", "hello world"}, io.Discard)
test.OK(t, err)