aboutsummaryrefslogtreecommitdiff
path: root/builder/builder2v1/build_relationship_test.go
blob: c8a2dacbdf21354d5d03eef17d181d549fd1b083 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later

package builder2v1

import (
	"testing"
)

// ===== Relationship section builder tests =====
func TestBuilder2_1CanBuildRelationshipSection(t *testing.T) {
	packageName := "project17"

	rln, err := BuildRelationshipSection2_1(packageName)
	if err != nil {
		t.Fatalf("expected nil error, got %v", err)
	}

	if rln == nil {
		t.Fatalf("expected non-nil relationship, got nil")
	}
	if rln.RefA != "SPDXRef-DOCUMENT" {
		t.Errorf("expected %v, got %v", "SPDXRef-DOCUMENT", rln.RefA)
	}
	if rln.RefB != "SPDXRef-Package-project17" {
		t.Errorf("expected %v, got %v", "SPDXRef-Package-project17", rln.RefB)
	}
	if rln.Relationship != "DESCRIBES" {
		t.Errorf("expected %v, got %v", "DESCRIBES", rln.Relationship)
	}

}