Skip to content
Closed
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
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ require (
golang.org/x/mobile v0.0.0-20250606033058-a2a15c67f36f // indirect
golang.org/x/sync v0.21.0 // indirect
)

replace mvdan.cc/sh/v3 => github.com/roeyazroel/sh/v3 v3.13.2-0.20260809125237-e2f38fbcc51c
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ github.com/pelletier/go-toml/v2 v2.4.3 h1:GTRvJQutkOSftxIFD5xw9aepkYNuPWmVJpffdD
github.com/pelletier/go-toml/v2 v2.4.3/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/roeyazroel/sh/v3 v3.13.2-0.20260809125237-e2f38fbcc51c h1:LFjbY5nlp75uSZ9vkefrt4xevb0FyYsykdDQtvyxbT8=
github.com/roeyazroel/sh/v3 v3.13.2-0.20260809125237-e2f38fbcc51c/go.mod h1:lXJ8SexMvEVcHCoDvAGLZgFJ9Wsm2sulmoNEXGhYZD0=
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
Expand All @@ -75,5 +77,3 @@ golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0=
golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w=
mvdan.cc/sh/v3 v3.13.1 h1:DP3TfgZhDkT7lerUdnp6PTGKyxxzz6T+cOlY/xEvfWk=
mvdan.cc/sh/v3 v3.13.1/go.mod h1:lXJ8SexMvEVcHCoDvAGLZgFJ9Wsm2sulmoNEXGhYZD0=
19 changes: 19 additions & 0 deletions internal/executor/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import (
"os"
osexec "os/exec"
"path/filepath"
"regexp"
"strings"
"testing"
"time"

"github.com/creack/pty"
"github.com/tfcace/hash/internal/version"
"mvdan.cc/sh/v3/pattern"
"mvdan.cc/sh/v3/syntax"
)

Expand Down Expand Up @@ -1329,6 +1331,23 @@ fi
}
}

func TestShellPattern_NegatedPOSIXClassCompiles(t *testing.T) {
expr, err := pattern.Regexp(`*[![:space:]]*`, pattern.EntireString)
if err != nil {
t.Fatalf("NVM shell pattern failed: %v", err)
}
rx, err := regexp.Compile(expr)
if err != nil {
t.Fatalf("NVM shell pattern produced invalid regexp %q: %v", expr, err)
}
if !rx.MatchString("lts/krypton") {
t.Fatal("NVM shell pattern should match a non-space alias")
}
if rx.MatchString(" \t") {
t.Fatal("NVM shell pattern should not match an all-space alias")
}
}

func TestExecutor_StatementRecoveryDoesNotPrintUnsupportedNoise(t *testing.T) {
exec := New()
var stderr bytes.Buffer
Expand Down
Loading