fix realPath for first nested archives

Signed-off-by: Kudryavcev Nikolay <kydry.nikolau@gmail.com>
This commit is contained in:
Kudryavcev Nikolay
2025-07-02 01:00:02 +03:00
parent 8f784b5dd0
commit 8cfef40b9c
3 changed files with 20 additions and 9 deletions
+17 -1
View File
@@ -10,6 +10,8 @@ import (
)
func TestArchiveScan(t *testing.T) {
archive := createArchive(t, "test-fixtures/archive", t.TempDir())
nestedArchive := createArchive(t, filepath.Dir(archive), t.TempDir())
tests := []struct {
name string
args []string
@@ -23,7 +25,21 @@ func TestArchiveScan(t *testing.T) {
"scan",
"-o",
"json",
"file:" + createArchive(t, "test-fixtures/archive", t.TempDir()),
"file:" + archive,
},
assertions: []traitAssertion{
assertSuccessfulReturnCode,
assertJsonReport,
assertPackageCount(1),
},
},
{
name: "scan an nested archive within the temp dir",
args: []string{
"scan",
"-o",
"json",
"file:" + nestedArchive,
},
assertions: []traitAssertion{
assertSuccessfulReturnCode,