diff options
Diffstat (limited to 'spdxconv_test.go')
| -rw-r--r-- | spdxconv_test.go | 61 |
1 files changed, 3 insertions, 58 deletions
diff --git a/spdxconv_test.go b/spdxconv_test.go index fe8ad1c..1496e14 100644 --- a/spdxconv_test.go +++ b/spdxconv_test.go @@ -140,6 +140,9 @@ func TestScan(t *testing.T) { dir: `testdata/scan/`, expReport: string(testData.Output[`scan/spdxconv.report`]), }, { + dir: `testdata/scan_no_scm/`, + expReport: string(testData.Output[`scan_no_scm/spdxconv.report`]), + }, { dir: `testdata/Scan_noConfigAndReport/`, expReport: string(testData.Output[`Scan_noConfigAndReport/spdxconv.report`]), }} @@ -334,61 +337,3 @@ func TestSPDXConv_scanFile(t *testing.T) { test.Assert(t, tc.dir+"/"+tc.name, tc.exp, got) } } - -func TestSPDXConv_scanDir(t *testing.T) { - type testCase struct { - dir string - exp []string - } - var listCase = []testCase{{ - dir: `testdata/scan/`, - exp: []string{ - `.gitignore`, - `Makefile`, - `a/b/.gitignore`, - `go.mod`, - `go.sum`, - `no_copyright_year.md`, - `po/included.go`, - `po/test.po`, - `po/test.pot`, - `test.go`, - `test.html`, - `test.json`, - `test.sh`, - `test.sql`, - `with_spdx.go`, - }, - }, { - dir: `testdata/scan_no_scm/`, - exp: []string{ - `test.go`, - `test.html`, - `test.sh`, - }, - }} - var tc testCase - var conv *SPDXConv - var err error - var got []string - for _, tc = range listCase { - t.Run(tc.dir, func(tt *testing.T) { - tt.Chdir(tc.dir) - - conv, err = New(`.`) - if err != nil { - tt.Fatal(err) - } - err = conv.prepareScan() - if err != nil { - t.Fatal(err) - } - - got, err = conv.scanDir([]string{`.`}) - if err != nil { - tt.Fatal(err) - } - test.Assert(tt, tc.dir, tc.exp, got) - }) - } -} |
