build: use the same technique to disable upstream profile on all distribution.
Only enabled on Ubuntu & opensuse
This commit is contained in:
parent
c40c3e1c98
commit
34973baaea
6 changed files with 45 additions and 95 deletions
|
|
@ -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()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue