aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spdx/model.go2
-rw-r--r--spdxlib/documents_test.go23
2 files changed, 24 insertions, 1 deletions
diff --git a/spdx/model.go b/spdx/model.go
index cc31d2a..e91856b 100644
--- a/spdx/model.go
+++ b/spdx/model.go
@@ -64,7 +64,7 @@ const (
const (
// F.2 Security types
- CatagorySecurity = common.CategorySecurity
+ CategorySecurity = common.CategorySecurity
SecurityCPE23Type = common.TypeSecurityCPE23Type
SecurityCPE22Type = common.TypeSecurityCPE22Type
SecurityAdvisory = common.TypeSecurityAdvisory
diff --git a/spdxlib/documents_test.go b/spdxlib/documents_test.go
index 3219b20..7a39cce 100644
--- a/spdxlib/documents_test.go
+++ b/spdxlib/documents_test.go
@@ -23,6 +23,9 @@ func TestValidDocumentPassesValidation(t *testing.T) {
{PackageName: "pkg4", PackageSPDXIdentifier: "p4"},
{PackageName: "pkg5", PackageSPDXIdentifier: "p5"},
},
+ Files: []*spdx.File{
+ {FileName: "file1", FileSPDXIdentifier: "f1"},
+ },
Relationships: []*spdx.Relationship{
{
RefA: common.MakeDocElementID("", "DOCUMENT"),
@@ -91,4 +94,24 @@ func TestInvalidDocumentFailsValidation(t *testing.T) {
if err == nil {
t.Fatalf("expected non-nil error, got nil")
}
+
+ doc = &spdx.Document{
+ SPDXVersion: spdx.Version,
+ DataLicense: spdx.DataLicense,
+ SPDXIdentifier: common.ElementID("DOCUMENT"),
+ CreationInfo: &spdx.CreationInfo{},
+
+ Relationships: []*spdx.Relationship{
+ {
+ RefA: common.MakeDocElementID("", "p1"),
+ RefB: common.MakeDocElementID("", "p99"),
+ Relationship: "DEPENDS_ON",
+ },
+ },
+ }
+
+ err = ValidateDocument(doc)
+ if err == nil {
+ t.Fatalf("expected non-nil error, got nil")
+ }
}