Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ghsa/ghsa.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ func ghsaToOSVEcosystem(ghsaEco string) string {
case ecoPub:
return "Pub"
case ecoSwift:
return "SwiftPM"
return "SwiftURL"
default:
return ghsaEco
}
Expand Down
25 changes: 25 additions & 0 deletions ghsa/ghsa_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package ghsa

import "testing"

func TestGHSAToOSVEcosystem(t *testing.T) {
tests := []struct {
name string
ecosystem string
want string
}{
{
name: "swift uses the OSV schema ecosystem name",
ecosystem: ecoSwift,
want: "SwiftURL",
},
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := ghsaToOSVEcosystem(tt.ecosystem); got != tt.want {
t.Errorf("ghsaToOSVEcosystem(%q) = %q, want %q", tt.ecosystem, got, tt.want)
}
})
}
}