go-container/devenv/shell_test.go
Virgil 6abb69e1a4 refactor(container): complete AX compliance pass
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-29 17:37:24 +00:00

47 lines
1,006 B
Go

package devenv
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestShellOptions_Good_Default(t *testing.T) {
opts := ShellOptions{}
assert.False(t, opts.Console)
assert.Nil(t, opts.Command)
}
func TestShellOptions_Good_Console(t *testing.T) {
opts := ShellOptions{
Console: true,
}
assert.True(t, opts.Console)
assert.Nil(t, opts.Command)
}
func TestShellOptions_Good_Command(t *testing.T) {
opts := ShellOptions{
Command: []string{"ls", "-la"},
}
assert.False(t, opts.Console)
assert.Equal(t, []string{"ls", "-la"}, opts.Command)
}
func TestShellOptions_Good_ConsoleWithCommand(t *testing.T) {
opts := ShellOptions{
Console: true,
Command: []string{"echo", "hello"},
}
assert.True(t, opts.Console)
assert.Equal(t, []string{"echo", "hello"}, opts.Command)
}
func TestShellOptions_Good_EmptyCommand(t *testing.T) {
opts := ShellOptions{
Command: []string{},
}
assert.False(t, opts.Console)
assert.Empty(t, opts.Command)
assert.Len(t, opts.Command, 0)
}