mirror of
https://github.com/anchore/syft.git
synced 2026-11-04 00:16:38 +01:00
--------- Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
35 lines
640 B
Go
35 lines
640 B
Go
package cyclonedxjson
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/CycloneDX/cyclonedx-go"
|
|
)
|
|
|
|
func TestFormatVersions(t *testing.T) {
|
|
tests := []struct {
|
|
name string
|
|
expectedVersion string
|
|
}{
|
|
{
|
|
|
|
"cyclonedx-json should default to v1.4",
|
|
cyclonedx.SpecVersion1_4.String(),
|
|
},
|
|
}
|
|
|
|
for _, c := range tests {
|
|
c := c
|
|
t.Run(c.name, func(t *testing.T) {
|
|
sbomFormat := Format()
|
|
if sbomFormat.ID() != ID {
|
|
t.Errorf("expected ID %q, got %q", ID, sbomFormat.ID())
|
|
}
|
|
|
|
if sbomFormat.Version() != c.expectedVersion {
|
|
t.Errorf("expected version %q, got %q", c.expectedVersion, sbomFormat.Version())
|
|
}
|
|
})
|
|
}
|
|
}
|