aboutsummaryrefslogtreecommitdiff
path: root/testdata
diff options
context:
space:
mode:
Diffstat (limited to 'testdata')
-rw-r--r--testdata/Apply_test.txt12
-rw-r--r--testdata/loadConfig/config_exists/spdxconv.cfg14
-rw-r--r--testdata/loadReport/ok/spdxconv.report6
-rw-r--r--testdata/scan/no_copyright_year.md7
-rw-r--r--testdata/scan/spdxconv.cfg16
-rw-r--r--testdata/scan/test.sh6
-rw-r--r--testdata/scan/test.sql5
7 files changed, 40 insertions, 26 deletions
diff --git a/testdata/Apply_test.txt b/testdata/Apply_test.txt
index 8107ee8..a8c3e6d 100644
--- a/testdata/Apply_test.txt
+++ b/testdata/Apply_test.txt
@@ -48,14 +48,16 @@ prefix = "%"
pattern = "^.*\\.(apk|app|bz2|csv|doc|docx|exe|gif|gz|jpeg|jpg|json|pdf|png|ppt|pptx|svg|svgz|tar|tgz|xls|xlsx|zip)$"
[match-license]
-pattern = "^(//+|#+|/\\*+|<!--+)?\\s*(.*)governed by a BSD-style(.*)$"
+pattern = "^(//+|#+|/\\*+|<!--+|--+)?\\s*(.*)governed by a BSD-style(.*)$"
license_identifier = BSD-3-Clause
-delete_line_after = "^(//+|#+|/\\*+|<!--+)?\\s*license that can(.*)$"
-delete_line_after = "^(//+|#+|\\*+/|--+>)$"
+delete_line_before = "^(//+|#+|/\\*+|<!--+|--+)$"
+delete_line_after = "^(//+|#+|/\\*+|<!--+|--+)?\\s*license that can(.*)$"
+delete_line_after = "^(//+|#+|\\*+/|--+>|--+)$"
[match-copyright]
-pattern = "^(//+|#+|/\\*+|<!--+)?\\s*Copyright\\s+(?<year>\\d{4}),?\\s+(?<author>.*)\\s+<(?<contact>.*)>.*$"
-delete_line_before = "^(//+|#+|/\\*+|<!--+)$"
+pattern = "^(//+|#+|/\\*+|<!--+|--+)?\\s*Copyright\\s+(?<year>\\d{4}),?\\s+(?<author>.*)\\s+<(?<contact>.*)>.*$"
+delete_line_before = "^(//+|#+|/\\*+|<!--+|--+)$"
+delete_line_after = "^(//+|#+|\\*+/|--+>|--+)$"
>>> without_spdx_license_id.go
1
diff --git a/testdata/loadConfig/config_exists/spdxconv.cfg b/testdata/loadConfig/config_exists/spdxconv.cfg
index 1f7ff68..b92f0c8 100644
--- a/testdata/loadConfig/config_exists/spdxconv.cfg
+++ b/testdata/loadConfig/config_exists/spdxconv.cfg
@@ -43,13 +43,13 @@ prefix = "%"
pattern = "^.*\\.(apk|app|bz2|csv|doc|docx|exe|gif|gz|jpeg|jpg|json|pdf|png|ppt|pptx|svg|svgz|tar|tgz|xls|xlsx|zip)$"
[match-license]
-pattern = "^(//+|#+|/\\*+|<!--+)?\\s*(.*)governed by a BSD-style(.*)$"
+pattern = "^(//+|#+|/\\*+|<!--+|--+)?\\s*(.*)governed by a BSD-style(.*)$"
license_identifier = BSD-3-Clause
-delete_line_before = "^(//+|#+|/\\*+|<!--+)$"
-delete_line_after = "^(//+|#+|/\\*+|<!--+)?\\s*license that can(.*)$"
-delete_line_after = "^(//+|#+|\\*+/|--+>)$"
+delete_line_before = "^(//+|#+|/\\*+|<!--+|--+)$"
+delete_line_after = "^(//+|#+|/\\*+|<!--+|--+)?\\s*license that can(.*)$"
+delete_line_after = "^(//+|#+|\\*+/|--+>|--+)$"
[match-copyright]
-pattern = "^(//+|#+|/\\*+|<!--+)?\\s*Copyright\\s+(?<year>\\d{4}),?\\s+(?<author>.*)\\s+<(?<contact>.*)>.*$"
-delete_line_before = "^(//+|#+|/\\*+|<!--+)$"
-delete_line_after = "^(//+|#+|\\*+/|--+>)$"
+pattern = "^(//+|#+|/\\*+|<!--+|--+)?\\s*Copyright\\s+(?<year>\\d{4}),?\\s+(?<author>.*)\\s+<(?<contact>.*)>.*$"
+delete_line_before = "^(//+|#+|/\\*+|<!--+|--+)$"
+delete_line_after = "^(//+|#+|\\*+/|--+>|--+)$"
diff --git a/testdata/loadReport/ok/spdxconv.report b/testdata/loadReport/ok/spdxconv.report
index ef027b8..cfb222d 100644
--- a/testdata/loadReport/ok/spdxconv.report
+++ b/testdata/loadReport/ok/spdxconv.report
@@ -3,14 +3,14 @@
// comment
//spdxconv:regular
-fileR1,default,0,unknown,default,0,# ,
+fileR1,default,0,,default,0,# ,
file R2,exist,1,2024,exist,-1,// ,
fileR3,match,-2,2000-2026,match,-3,<!-- ," -->"
//spdxconv:binary
-fileB1,default,0,unknown,default,0,,
+fileB1,default,0,,default,0,,
// comment
//spdxconv:unknown
// comment
-fileU1,default,0,unknown,default,0,,
+fileU1,default,0,,default,0,,
diff --git a/testdata/scan/no_copyright_year.md b/testdata/scan/no_copyright_year.md
new file mode 100644
index 0000000..be47d2e
--- /dev/null
+++ b/testdata/scan/no_copyright_year.md
@@ -0,0 +1,7 @@
+<!--
+Copyright Shulhan <ms@kilabit.info>. All rights reserved.
+Use of this source code is governed by a BSD-style
+license that can be found in the LICENSE file.
+-->
+
+The copyrightYear will use the default one.
diff --git a/testdata/scan/spdxconv.cfg b/testdata/scan/spdxconv.cfg
index 1cdfefb..082d482 100644
--- a/testdata/scan/spdxconv.cfg
+++ b/testdata/scan/spdxconv.cfg
@@ -3,7 +3,7 @@
[default]
license_identifier = GPL-3.0-only
-copyright_year = 2026
+copyright_year = 2025
file_copyright_text = Author <contact@email.local>
max_line_match = 10
@@ -48,13 +48,13 @@ pattern = "^.*\\.(apk|app|bz2|csv|doc|docx|exe|gif|gz|jpeg|jpg|json|pdf|png|ppt|
pattern = "^.*\\.(apk|app|bz2|csv|doc|docx|exe|gif|gz|jpeg|jpg|json|pdf|png|ppt|pptx|svg|svgz|tar|tgz|xls|xlsx|zip)$"
[match-license]
-pattern = "^(//+|#+|/\\*+|<!--+)?\\s*(.*)governed by a BSD-style(.*)$"
+pattern = "^(//+|#+|/\\*+|<!--+|--+)?\\s*(.*)governed by a BSD-style(.*)$"
license_identifier = BSD-3-Clause
-delete_line_before = "^(//+|#+|/\\*+|<!--+)$"
-delete_line_after = "^(//+|#+|/\\*+|<!--+)?\\s*license that can(.*)$"
-delete_line_after = "^(//+|#+|\\*+/|--+>)$"
+delete_line_before = "^(//+|#+|/\\*+|<!--+|--+)$"
+delete_line_after = "^(//+|#+|/\\*+|<!--+|--+)?\\s*license that can(.*)$"
+delete_line_after = "^(//+|#+|\\*+/|--+>|--+)$"
[match-copyright]
-pattern = "^(//+|#+|/\\*+|<!--+)?\\s*Copyright\\s+(?<year>\\d{4}),?\\s+(?<author>.*)\\s+<(?<contact>.*)>.*$"
-delete_line_before = "^(//+|#+|/\\*+|<!--+)$"
-delete_line_after = "^(//+|#+|\\*+/|--+>)$"
+pattern = "^(//+|#+|/\\*+|<!--+|--+)?\\s*Copyright\\s+(?<year>\\d{4}),?\\s+(?<author>.*)\\s+<(?<contact>.*)>.*$"
+delete_line_before = "^(//+|#+|/\\*+|<!--+|--+)$"
+delete_line_after = "^(//+|#+|\\*+/|--+>|--+)$"
diff --git a/testdata/scan/test.sh b/testdata/scan/test.sh
index 8fd6949..13b4657 100644
--- a/testdata/scan/test.sh
+++ b/testdata/scan/test.sh
@@ -1,3 +1,3 @@
-# Copyright 2022, Shulhan <ms@kilabit.info>. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file. \ No newline at end of file
+#!/bin/sh
+
+# Test getYearFromSCM.
diff --git a/testdata/scan/test.sql b/testdata/scan/test.sql
new file mode 100644
index 0000000..86d55b3
--- /dev/null
+++ b/testdata/scan/test.sql
@@ -0,0 +1,5 @@
+-- Copyright 2022, Shulhan <ms@kilabit.info>. All rights reserved.
+-- Use of this source code is governed by a BSD-style
+-- license that can be found in the LICENSE file.
+
+-- comment