-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
Fixes #4957 Signed-off-by: Salim Afiune Maya <[email protected]>
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,19 +23,27 @@ func TestMacOsXPackageParser(t *testing.T) { | |
} | ||
assert.Nil(t, err) | ||
|
||
m, err := packages.ParseMacOSPackages(c.Stdout) | ||
pf := &inventory.Platform{ | ||
Name: "macos", | ||
Version: "15.2", | ||
Arch: "x86_64", | ||
Family: []string{"darwin", "bsd", "unix", "os"}, | ||
} | ||
m, err := packages.ParseMacOSPackages(pf, c.Stdout) | ||
assert.Nil(t, err) | ||
assert.Equal(t, 2, len(m), "detected the right amount of packages") | ||
|
||
assert.Equal(t, "Preview", m[0].Name, "pkg name detected") | ||
assert.Equal(t, "10.0", m[0].Version, "pkg version detected") | ||
assert.Equal(t, packages.MacosPkgFormat, m[0].Format, "pkg format detected") | ||
assert.Equal(t, packages.PkgFilesIncluded, m[0].FilesAvailable) | ||
assert.Equal(t, "pkg:macos/[email protected]?arch=x86_64&distro=macos-15.2", m[0].PUrl) | ||
assert.Equal(t, []packages.FileRecord{{Path: "/Applications/Preview.app"}}, m[0].Files) | ||
|
||
assert.Equal(t, "Contacts", m[1].Name, "pkg name detected") | ||
assert.Equal(t, "11.0", m[1].Version, "pkg version detected") | ||
assert.Equal(t, packages.MacosPkgFormat, m[1].Format, "pkg format detected") | ||
assert.Equal(t, packages.PkgFilesIncluded, m[1].FilesAvailable) | ||
assert.Equal(t, "pkg:macos/[email protected]?arch=x86_64&distro=macos-15.2", m[1].PUrl) | ||
assert.Equal(t, []packages.FileRecord{{Path: "/Applications/Contacts.app"}}, m[1].Files) | ||
} |