Skip to content

Commit

Permalink
Avoid regressions
Browse files Browse the repository at this point in the history
  • Loading branch information
sourishkrout committed Jun 6, 2024
1 parent c296201 commit ae3fd6d
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions internal/runner/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,34 @@ func Test_command(t *testing.T) {
assert.Equal(t, "", string(data))
})

t.Run("Shellscript", func(t *testing.T) {
t.Parallel()

stdout := new(bytes.Buffer)
stderr := new(bytes.Buffer)

cmd, err := newCommand(
&commandConfig{
ProgramName: "",
LanguageID: "shellscript",
Stdout: stdout,
Stderr: stderr,
CommandMode: CommandModeTempFile,
Script: `echo "run this as shell script"`,
Logger: testCreateLogger(t),
},
)
require.NoError(t, err)
require.NoError(t, cmd.Start(context.Background()))
require.NoError(t, cmd.Wait())
data, err := io.ReadAll(stdout)
assert.NoError(t, err)
assert.Equal(t, "run this as shell script\n", string(data))
data, err = io.ReadAll(stderr)
assert.NoError(t, err)
assert.Equal(t, "", string(data))
})

t.Run("JavaScript", func(t *testing.T) {
t.Parallel()

Expand Down

0 comments on commit ae3fd6d

Please sign in to comment.