aboutsummaryrefslogtreecommitdiff
path: root/spdxconv_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'spdxconv_test.go')
-rw-r--r--spdxconv_test.go32
1 files changed, 32 insertions, 0 deletions
diff --git a/spdxconv_test.go b/spdxconv_test.go
index aa37cba..f473a2e 100644
--- a/spdxconv_test.go
+++ b/spdxconv_test.go
@@ -189,6 +189,38 @@ func TestApply(t *testing.T) {
}
}
+func TestApply_fromReport(t *testing.T) {
+ // Populate the test files.
+
+ var testData *test.Data
+ var err error
+ testData, err = test.LoadData(`testdata/Apply_fromReport_test.txt`)
+ if err != nil {
+ t.Fatal(err)
+ }
+ var tempDir = `testdata/Apply_fromReport/`
+ testData.ExtractInput(tempDir)
+ t.Chdir(tempDir)
+
+ err = Apply()
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ for input, _ := range testData.Input {
+ if input == ConfigFile || input == ReportFile {
+ continue
+ }
+
+ got, err := os.ReadFile(input)
+ if err != nil {
+ t.Fatal(err)
+ }
+ test.Assert(t, input+`: after`,
+ string(testData.Output[input]), string(got))
+ }
+}
+
func TestNew(t *testing.T) {
type testCase struct {
exp *SPDXConv