Skip to content

Commit

Permalink
test: add package with slash into test
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyLewen committed Dec 29, 2023
1 parent 053adc2 commit 717ef21
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 18 deletions.
49 changes: 31 additions & 18 deletions pkg/fanal/analyzer/language/nodejs/npm/npm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@ func Test_npmLibraryAnalyzer_Analyze(t *testing.T) {
Type: types.Npm,
FilePath: "package-lock.json",
Libraries: types.Packages{
{
ID: "@babel/parser@7.23.6",
Name: "@babel/parser",
Version: "7.23.6",
Indirect: true,
Licenses: []string{"MIT"},
Locations: []types.Location{
{
StartLine: 6,
EndLine: 10,
},
},
},
{
ID: "ansi-colors@3.2.3",
Name: "ansi-colors",
Expand All @@ -42,8 +55,8 @@ func Test_npmLibraryAnalyzer_Analyze(t *testing.T) {
Indirect: true,
Locations: []types.Location{
{
StartLine: 6,
EndLine: 11,
StartLine: 11,
EndLine: 16,
},
},
},
Expand All @@ -54,8 +67,8 @@ func Test_npmLibraryAnalyzer_Analyze(t *testing.T) {
Indirect: true,
Locations: []types.Location{
{
StartLine: 12,
EndLine: 16,
StartLine: 17,
EndLine: 21,
},
},
},
Expand All @@ -68,8 +81,8 @@ func Test_npmLibraryAnalyzer_Analyze(t *testing.T) {
Licenses: []string{"MIT"},
Locations: []types.Location{
{
StartLine: 17,
EndLine: 39,
StartLine: 22,
EndLine: 44,
},
},
},
Expand All @@ -82,12 +95,12 @@ func Test_npmLibraryAnalyzer_Analyze(t *testing.T) {
Licenses: []string{"MIT"},
Locations: []types.Location{
{
StartLine: 25,
EndLine: 32,
StartLine: 30,
EndLine: 37,
},
{
StartLine: 48,
EndLine: 55,
StartLine: 53,
EndLine: 60,
},
},
},
Expand All @@ -100,8 +113,8 @@ func Test_npmLibraryAnalyzer_Analyze(t *testing.T) {
Licenses: []string{"MIT"},
Locations: []types.Location{
{
StartLine: 40,
EndLine: 62,
StartLine: 45,
EndLine: 67,
},
},
},
Expand All @@ -113,12 +126,12 @@ func Test_npmLibraryAnalyzer_Analyze(t *testing.T) {
Licenses: []string{"MIT"},
Locations: []types.Location{
{
StartLine: 33,
EndLine: 37,
StartLine: 38,
EndLine: 42,
},
{
StartLine: 56,
EndLine: 60,
StartLine: 61,
EndLine: 65,
},
},
},
Expand All @@ -130,8 +143,8 @@ func Test_npmLibraryAnalyzer_Analyze(t *testing.T) {
Licenses: []string{"MIT"},
Locations: []types.Location{
{
StartLine: 63,
EndLine: 67,
StartLine: 68,
EndLine: 72,
},
},
},
Expand Down

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.

0 comments on commit 717ef21

Please sign in to comment.