Skip to content

Commit

Permalink
reverse dependsOn relationship
Browse files Browse the repository at this point in the history
Signed-off-by: Benji Visser <benji@093b.org>
  • Loading branch information
noqcks committed Sep 17, 2023
1 parent 2a35e1a commit 810b473
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
4 changes: 2 additions & 2 deletions syft/pkg/cataloger/dotnet/parse_dotnet_deps.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ func parseDotnetDeps(_ file.Resolver, _ *generic.Environment, reader file.Locati
continue
}
rel := artifact.Relationship{
From: pkg,
To: depPkg,
From: depPkg,
To: pkg,
Type: artifact.DependencyOfRelationship,
}
relationships = append(relationships, rel)
Expand Down
66 changes: 33 additions & 33 deletions syft/pkg/cataloger/dotnet/parse_dotnet_deps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,101 +250,101 @@ func TestParseDotnetDeps(t *testing.T) {

expectedRelationships := []artifact.Relationship{
{
From: msftDependencyInjection,
To: msftDependencyInjectionAbstractions,
From: awssdkcore,
To: testCommon,
Type: artifact.DependencyOfRelationship,
},
{
From: msftDependencyInjection,
To: systemRuntimeCompilerServicesUnsafe,
To: msftExtensionsLogging,
Type: artifact.DependencyOfRelationship,
},

{
From: msftExtensionsLogging,
To: msftDependencyInjection,
From: msftDependencyInjection,
To: rootPkg,
Type: artifact.DependencyOfRelationship,
},
{
From: msftExtensionsLogging,
To: msftDependencyInjectionAbstractions,
From: msftDependencyInjectionAbstractions,
To: msftDependencyInjection,
Type: artifact.DependencyOfRelationship,
},
{
From: msftExtensionsLogging,
To: msftLoggingAbstractions,
From: msftDependencyInjectionAbstractions,
To: msftExtensionsLogging,
Type: artifact.DependencyOfRelationship,
},
{
From: msftExtensionsLogging,
From: msftDependencyInjectionAbstractions,
To: msftExtensionsOptions,
Type: artifact.DependencyOfRelationship,
},
{
From: msftExtensionsLogging,
To: systemDiagnosticsDiagnosticsource,
To: rootPkg,
Type: artifact.DependencyOfRelationship,
},
{
From: msftExtensionsOptions,
To: msftDependencyInjectionAbstractions,
From: msftLoggingAbstractions,
To: msftExtensionsLogging,
Type: artifact.DependencyOfRelationship,
},
{
From: msftExtensionsOptions,
To: msftExtensionsPrimitives,
To: msftExtensionsLogging,
Type: artifact.DependencyOfRelationship,
},
{
From: msftExtensionsPrimitives,
To: systemRuntimeCompilerServicesUnsafe,
To: msftExtensionsOptions,
Type: artifact.DependencyOfRelationship,
},
{
From: serilogSinksConsole,
To: serilog,
From: newtonsoftJson,
To: rootPkg,
Type: artifact.DependencyOfRelationship,
},
{
From: systemDiagnosticsDiagnosticsource,
To: systemRuntimeCompilerServicesUnsafe,
From: serilog,
To: serilogSinksConsole,
Type: artifact.DependencyOfRelationship,
},
{
From: testCommon,
To: awssdkcore,
From: serilog,
To: rootPkg,
Type: artifact.DependencyOfRelationship,
},
{
From: rootPkg,
To: msftDependencyInjection,
From: serilogSinksConsole,
To: rootPkg,
Type: artifact.DependencyOfRelationship,
},
{
From: rootPkg,
From: systemDiagnosticsDiagnosticsource,
To: msftExtensionsLogging,
Type: artifact.DependencyOfRelationship,
},
{
From: rootPkg,
To: newtonsoftJson,
From: systemRuntimeCompilerServicesUnsafe,
To: msftDependencyInjection,
Type: artifact.DependencyOfRelationship,
},
{
From: rootPkg,
To: serilog,
From: systemRuntimeCompilerServicesUnsafe,
To: msftExtensionsPrimitives,
Type: artifact.DependencyOfRelationship,
},
{
From: rootPkg,
To: serilogSinksConsole,
From: systemRuntimeCompilerServicesUnsafe,
To: systemDiagnosticsDiagnosticsource,
Type: artifact.DependencyOfRelationship,
},
{
From: rootPkg,
To: testCommon,
From: testCommon,
To: rootPkg,
Type: artifact.DependencyOfRelationship,
},
}

pkgtest.TestFileParser(t, fixture, parseDotnetDeps, expectedPkgs, expectedRelationships)
}

0 comments on commit 810b473

Please sign in to comment.