(t *testing.T)
| 102 | } |
| 103 | |
| 104 | func TestGetShellHistory_FileNotExist(t *testing.T) { |
| 105 | setupShellTest(t, "bash", "") |
| 106 | |
| 107 | // Sobrescreve o mock de os.Stat para simular arquivo não encontrado |
| 108 | originalStat := osStat |
| 109 | osStat = func(name string) (os.FileInfo, error) { |
| 110 | return nil, os.ErrNotExist |
| 111 | } |
| 112 | t.Cleanup(func() { osStat = originalStat }) |
| 113 | |
| 114 | _, err := GetShellHistory() |
| 115 | assert.Error(t, err) |
| 116 | assert.Contains(t, err.Error(), "arquivo de histórico não encontrado") |
| 117 | } |
nothing calls this directly
no test coverage detected