mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
fix: harden and simplify Linux system install
Tighten shim detection, profile repair, and install ordering while trimming over-specific doctor/info hints from the system-install path. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package setup
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/safedep/pmg/internal/doctor"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestPathContainsDir(t *testing.T) {
|
||||
assert.True(t, pathContainsDir([]string{"/usr/local/lib/pmg/bin/"}, "/usr/local/lib/pmg/bin"))
|
||||
assert.False(t, pathContainsDir([]string{"/usr/local/bin"}, "/usr/local/lib/pmg/bin"))
|
||||
assert.False(t, pathContainsDir([]string{"/usr/bin"}, ""))
|
||||
}
|
||||
|
||||
func TestSystemShimsWithoutPathDoNotActivateInterception(t *testing.T) {
|
||||
results := []doctor.CheckResult{
|
||||
{Name: checkShellAliases, Status: doctor.StatusWarn},
|
||||
{Name: checkShimInPath, Status: doctor.StatusFail},
|
||||
}
|
||||
|
||||
assert.False(t, isInterceptionActive(results))
|
||||
}
|
||||
Reference in New Issue
Block a user