Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions internal/execute/execute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ func TestNewExpression(t *testing.T) {

func TestRun_Command(t *testing.T) {
t.Run("command is executed with bash", func(t *testing.T) {
cmd := New("echo $(type -a sh);", []string{})
// "type" (bash) output is locale sensitive
cmd := New("echo $(LANG=C type -a sh);", []string{})

var stdout strings.Builder
cmd.Stdout = &stdout
Expand Down Expand Up @@ -130,7 +131,8 @@ func TestRun_Command(t *testing.T) {

func TestRun_Expression(t *testing.T) {
t.Run("expression is executed with bash", func(t *testing.T) {
cmd := NewExpression("echo $(type -a sh)", []string{})
// "type" (bash) output is locale sensitive
cmd := NewExpression("echo $(LANG=C type -a sh)", []string{})

var stdout strings.Builder
cmd.Stdout = &stdout
Expand Down
4 changes: 4 additions & 0 deletions internal/git/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (
)

func TestRepoClone(t *testing.T) {
t.Setenv("LANG", "C") // error messages from git are locale dependent

t.Run("when repo name is valid but URL is invalid prints an error", func(t *testing.T) {
repo := NewRepo(t.TempDir())
err := repo.Clone("foobar", "")
Expand Down Expand Up @@ -94,6 +96,8 @@ func TestRepoRemoteURL(t *testing.T) {
}

func TestRepoUpdate(t *testing.T) {
t.Setenv("LANG", "C") // error messages from git are locale dependent

repoDir := generateRepo(t)
directory := t.TempDir()

Expand Down
2 changes: 2 additions & 0 deletions internal/plugins/plugins_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ func TestAdd(t *testing.T) {
})

t.Run("when plugin name is valid but URL is invalid prints an error", func(t *testing.T) {
t.Setenv("LANG", "C") // git error messages are locale dependent

conf := config.Config{DataDir: testDataDir}

err := Add(conf, "foo", "foobar", "")
Expand Down