build: use the same technique to disable upstream profile on all distribution.

Only enabled on Ubuntu & opensuse
This commit is contained in:
Alexandre Pujol 2024-06-04 19:52:06 +01:00
parent c40c3e1c98
commit 34973baaea
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
6 changed files with 45 additions and 95 deletions

View file

@ -102,64 +102,3 @@ code
})
}
}
func TestOverwriter_Get(t *testing.T) {
tests := []struct {
name string
content string
want []string
}{
{
name: "empty",
content: `
`,
want: []string{},
},
{
name: "main",
content: `
# This is managed globally
brave # not so brave
chrome
firefox
`,
want: []string{
"brave",
"chrome",
"firefox",
},
},
}
DistDir = paths.New("/tmp/")
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
err := DistDir.Join("overwrite").WriteFile([]byte(tt.content))
if err != nil {
return
}
if got := Overwrite.Get(); !reflect.DeepEqual(got, tt.want) {
t.Errorf("Overwriter.Get() = %v, want %v", got, tt.want)
}
})
}
}
func TestOverwriter_Apt(t *testing.T) {
tests := []struct {
name string
files []string
}{
{
name: "empty",
files: []string{},
},
}
DebianDir = paths.New("/tmp/")
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Overwrite.Apt(tt.files)
Overwrite.AptClean()
})
}
}