aboutsummaryrefslogtreecommitdiff
path: root/testdata/file_test.txt
diff options
context:
space:
mode:
Diffstat (limited to 'testdata/file_test.txt')
-rw-r--r--testdata/file_test.txt108
1 files changed, 108 insertions, 0 deletions
diff --git a/testdata/file_test.txt b/testdata/file_test.txt
new file mode 100644
index 0000000..dad7b85
--- /dev/null
+++ b/testdata/file_test.txt
@@ -0,0 +1,108 @@
+// SPDX-License-Identifier: GPL-3.0-only
+// SPDX-FileCopyrightText: 2025 M. Shulhan <ms@kilabit.info>
+
+>>> spdxconv.cfg
+# SPDX-License-Identifier: BSD-3-Clause
+# SPDX-FileCopyrightText: 2025 M. Shulhan <ms@kilabit.info>
+
+[default]
+license_identifier = GPL-3.0-only
+file_copyright_text = M. Shulhan <ms@kilabit.info>
+
+[match-license]
+pattern = "^(//+|#+)\\s+(.*)governed by a BSD-style(.*)$"
+license_identifier = BSD-3-Clause
+delete_match = true
+delete_line_pattern = "^(//+|#+)\\s*$"
+delete_line_pattern = "^(//+|#+)\\s+license that(.*)$"
+
+[match-copyright]
+pattern = "^(//+|#+)\\s+Copyright\\s+(?<year>\\d{4}),?\\s+(?<holder>.*)\\s+<*(?<email>.*)>.*$"
+
+>>> without_spdx_license_id.txt
+1
+2
+3
+
+<<< without_spdx_license_id.txt
+SPDX-License-Identifier: GPL-3.0-only
+1
+2
+3
+
+>>> with_spdx_at_bottom.txt
+1
+2
+3
+// SPDX-License-Identifier: GPL-3.0-only
+
+<<< with_spdx_at_bottom.txt
+// SPDX-License-Identifier: GPL-3.0-only
+
+1
+2
+3
+
+>>> with_spdx_license_id_only.txt
+// SPDX-License-Identifier: GPL-3.0-only
+1
+2
+3
+
+<<< with_spdx_license_id_only.txt
+// SPDX-License-Identifier: GPL-3.0-only
+
+1
+2
+3
+
+>>> with_no_order.txt
+// SPDX-FileCopyrightText: 2025 M. Shulhan <ms@kilabit.info>
+// SPDX-License-Identifier: BSD-3-Clause
+
+1
+2
+3
+
+<<< with_no_order.txt
+// SPDX-License-Identifier: BSD-3-Clause
+// SPDX-FileCopyrightText: 2025 M. Shulhan <ms@kilabit.info>
+
+1
+2
+3
+
+>>> with_match_license.txt
+// Copyright 2018, 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.
+
+1
+2
+3
+
+<<< with_match_license.txt
+// SPDX-License-Identifier: BSD-3-Clause
+// Copyright 2018, Shulhan <ms@kilabit.info>. All rights reserved.
+
+1
+2
+3
+
+>>> with_match_license_bottom.txt
+1
+2
+3
+
+// Copyright 2018, 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.
+
+<<< with_match_license_bottom.txt
+// SPDX-License-Identifier: BSD-3-Clause
+
+1
+2
+3
+
+// Copyright 2018, Shulhan <ms@kilabit.info>. All rights reserved.