Skip to content

Commit

Permalink
history: delete non-reproducible test
Browse files Browse the repository at this point in the history
  • Loading branch information
nalgeon committed Feb 9, 2025
1 parent 453eafb commit 7b325c5
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions history_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,31 +219,6 @@ func Test_getHistoryPath(t *testing.T) {
})
}

func Test_getHistoryPath_error(t *testing.T) {
// Save current environment variables and restore them after the test.
oldEnv := map[string]string{}
for _, env := range os.Environ() {
key, value, _ := strings.Cut(env, "=")
oldEnv[key] = value
}
defer func() {
os.Clearenv()
for k, v := range oldEnv {
os.Setenv(k, v)
}
}()

if runtime.GOOS == "windows" {
t.Skip("Skipping test on windows OS")
}

os.Setenv("HOME", "/root")
_, err := getHistoryPath()
if err == nil {
t.Fatalf("getHistoryPath should return an error")
}
}

func Test_loadHistory(t *testing.T) {
dir := t.TempDir()
path := filepath.Join(dir, "test_history.json")
Expand Down

0 comments on commit 7b325c5

Please sign in to comment.