aboutsummaryrefslogtreecommitdiff
path: root/tvsaver/saver2v2/save_relationship_test.go
diff options
context:
space:
mode:
authorBrandon Lum <lumjjb@gmail.com>2022-07-19 16:43:48 -0400
committerBrandon Lum <lumjjb@gmail.com>2022-07-19 22:43:24 -0400
commit9ae1bd2f8e0dabb0845f1225b54f23e8f3a429f1 (patch)
treea43213aadfb9bde3d9ec15634a39305f19ff38b2 /tvsaver/saver2v2/save_relationship_test.go
parent41d2272711255f5a25e16e3507ec3318bc550189 (diff)
downloadspdx-tools-9ae1bd2f8e0dabb0845f1225b54f23e8f3a429f1.tar.gz
replace all v2_1, v2_2 with new convention
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
Diffstat (limited to 'tvsaver/saver2v2/save_relationship_test.go')
-rw-r--r--tvsaver/saver2v2/save_relationship_test.go33
1 files changed, 17 insertions, 16 deletions
diff --git a/tvsaver/saver2v2/save_relationship_test.go b/tvsaver/saver2v2/save_relationship_test.go
index ebb3e37..927164c 100644
--- a/tvsaver/saver2v2/save_relationship_test.go
+++ b/tvsaver/saver2v2/save_relationship_test.go
@@ -6,14 +6,15 @@ import (
"bytes"
"testing"
- "github.com/spdx/tools-golang/spdx"
+ "github.com/spdx/tools-golang/spdx/common"
+ "github.com/spdx/tools-golang/spdx/v2_2"
)
// ===== Relationship section Saver tests =====
func TestSaver2_2RelationshipSavesText(t *testing.T) {
- rln := &spdx.Relationship2_2{
- RefA: spdx.MakeDocElementID("", "DOCUMENT"),
- RefB: spdx.MakeDocElementID("", "2"),
+ rln := &v2_2.Relationship{
+ RefA: common.MakeDocElementID("", "DOCUMENT"),
+ RefB: common.MakeDocElementID("", "2"),
Relationship: "DESCRIBES",
RelationshipComment: "this is a comment",
}
@@ -39,9 +40,9 @@ RelationshipComment: this is a comment
}
func TestSaver2_2RelationshipOmitsOptionalFieldsIfEmpty(t *testing.T) {
- rln := &spdx.Relationship2_2{
- RefA: spdx.MakeDocElementID("", "DOCUMENT"),
- RefB: spdx.MakeDocElementID("", "2"),
+ rln := &v2_2.Relationship{
+ RefA: common.MakeDocElementID("", "DOCUMENT"),
+ RefB: common.MakeDocElementID("", "2"),
Relationship: "DESCRIBES",
}
@@ -64,9 +65,9 @@ func TestSaver2_2RelationshipOmitsOptionalFieldsIfEmpty(t *testing.T) {
}
func TestSaver2_2RelationshipCanHaveNONEOnRight(t *testing.T) {
- rln := &spdx.Relationship2_2{
- RefA: spdx.MakeDocElementID("", "PackageA"),
- RefB: spdx.MakeDocElementSpecial("NONE"),
+ rln := &v2_2.Relationship{
+ RefA: common.MakeDocElementID("", "PackageA"),
+ RefB: common.MakeDocElementSpecial("NONE"),
Relationship: "DEPENDS_ON",
}
@@ -89,9 +90,9 @@ func TestSaver2_2RelationshipCanHaveNONEOnRight(t *testing.T) {
}
func TestSaver2_2RelationshipCanHaveNOASSERTIONOnRight(t *testing.T) {
- rln := &spdx.Relationship2_2{
- RefA: spdx.MakeDocElementID("", "PackageA"),
- RefB: spdx.MakeDocElementSpecial("NOASSERTION"),
+ rln := &v2_2.Relationship{
+ RefA: common.MakeDocElementID("", "PackageA"),
+ RefB: common.MakeDocElementSpecial("NOASSERTION"),
Relationship: "DEPENDS_ON",
}
@@ -114,9 +115,9 @@ func TestSaver2_2RelationshipCanHaveNOASSERTIONOnRight(t *testing.T) {
}
func TestSaver2_2RelationshipWrapsCommentMultiLine(t *testing.T) {
- rln := &spdx.Relationship2_2{
- RefA: spdx.MakeDocElementID("", "DOCUMENT"),
- RefB: spdx.MakeDocElementID("", "2"),
+ rln := &v2_2.Relationship{
+ RefA: common.MakeDocElementID("", "DOCUMENT"),
+ RefB: common.MakeDocElementID("", "2"),
Relationship: "DESCRIBES",
RelationshipComment: `this is a
multi-line comment`,