fixed issue #2471 where it wouldn't show info when packages are in a group (#2576)

fixed issue #2471 where it wouldn't show info when packages are in a group and modified test
This commit is contained in:
Dominik Link
2025-02-17 15:28:35 +01:00
committed by GitHub
parent 6807ecc081
commit d37e365ac3
2 changed files with 31 additions and 0 deletions

View File

@@ -84,6 +84,12 @@ func TestSyncInfo(t *testing.T) {
wantShow: []string{},
wantErr: true,
},
{
name: "Si arduino",
args: []string{"S", "i"},
targets: []string{"arduino"},
wantShow: []string{"pacman", "-S", "-i", "--config", "/etc/pacman.conf", "--", "arduino-cli"},
},
}
dbExc := &mock.DBExecutor{
@@ -94,9 +100,20 @@ func TestSyncInfo(t *testing.T) {
PBase: "linux",
}
}
if s == "arduino-cli" {
return &mock.Package{
PName: "arduino-cli",
PBase: "arduino-cli",
}
}
return nil
},
PackagesFromGroupFn: func(s string) []mock.IPackage {
if s == "arduino" {
return []mock.IPackage{
&mock.Package{PName: "arduino-cli"},
}
}
return nil
},
}