1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-28 07:22:50 -05:00

feat: matugen detects flatpak installations of zenbrowser and vesktop (#1251)

* feat: matugen detects flatpak installations of zenbrowser and vesktop

* fix: add flatpak deps on precommit runner

* fix: address short circuit conditions
This commit is contained in:
Ryan Bateman
2026-01-03 11:28:39 -09:00
committed by GitHub
parent f0f2e6ef72
commit 02166a4ca5
5 changed files with 387 additions and 22 deletions

View File

@@ -208,3 +208,42 @@ func TestFlatpakInstallationDirCommandFailure(t *testing.T) {
t.Errorf("expected 'not installed' error, got: %v", err)
}
}
func TestAnyFlatpakExistsSomeExist(t *testing.T) {
if !FlatpakInPath() {
t.Skip("flatpak not in PATH")
}
result := AnyFlatpakExists("com.nonexistent.flatpak", "app.zen_browser.zen", "com.another.nonexistent")
if !result {
t.Errorf("expected true when at least one flatpak exists")
}
}
func TestAnyFlatpakExistsNoneExist(t *testing.T) {
if !FlatpakInPath() {
t.Skip("flatpak not in PATH")
}
result := AnyFlatpakExists("com.nonexistent.flatpak1", "com.nonexistent.flatpak2")
if result {
t.Errorf("expected false when no flatpaks exist")
}
}
func TestAnyFlatpakExistsNoFlatpak(t *testing.T) {
tempDir := t.TempDir()
t.Setenv("PATH", tempDir)
result := AnyFlatpakExists("any.package.name", "another.package")
if result {
t.Errorf("expected false when flatpak not in PATH, got true")
}
}
func TestAnyFlatpakExistsEmpty(t *testing.T) {
result := AnyFlatpakExists()
if result {
t.Errorf("expected false when no flatpaks specified")
}
}