feat(build): rewrite the dbus directive fot the new format.

This commit is contained in:
Alexandre Pujol 2024-03-21 22:09:16 +00:00
parent b32ee4a5a9
commit 99e386705f
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
3 changed files with 325 additions and 0 deletions

View file

@ -61,3 +61,32 @@ func TestNewOption(t *testing.T) {
})
}
}
func TestRun(t *testing.T) {
tests := []struct {
name string
file *paths.Path
profile string
want string
}{
{
name: "none",
file: nil,
profile: ` `,
want: ` `,
},
{
name: "present",
file: nil,
profile: ` #aa:dbus own bus=system name=org.freedesktop.systemd1`,
want: dbusOwnSystemd1,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := Run(tt.file, tt.profile); got != tt.want {
t.Errorf("Run() = %v, want %v", got, tt.want)
}
})
}
}