diff --git a/tests/licensedcode/data/false_positive/false-positive-gpl3.txt b/tests/licensedcode/data/false_positive/false-positive-gpl3.txt new file mode 100644 index 00000000000..a4463bd4cc1 --- /dev/null +++ b/tests/licensedcode/data/false_positive/false-positive-gpl3.txt @@ -0,0 +1,17 @@ + .chip = { + .base = S5PC100_GPL1(0), + .ngpio = S5PC100_GPIO_L1_NR, + .label = "GPL1", + }, +}, { + .chip = { + .base = S5PC100_GPL2(0), + .ngpio = S5PC100_GPIO_L2_NR, + .label = "GPL2", + }, +}, { + .chip = { + .base = S5PC100_GPL3(0), + .ngpio = S5PC100_GPIO_L3_NR, + .label = "GPL3", + }, \ No newline at end of file diff --git a/tests/licensedcode/test_detect.py b/tests/licensedcode/test_detect.py index a99b7d61195..cf1d70ec8a2 100644 --- a/tests/licensedcode/test_detect.py +++ b/tests/licensedcode/test_detect.py @@ -1311,3 +1311,10 @@ def test_detection_return_correct_mit_not_apache_using_full_index(self): matches = idx.match(location=query_location) results = [m.rule.license_expression for m in matches] assert results == expected + + def test_detection_returns_correct_no_gpl3_false_positive(self): + idx = cache.get_index() + query_location = self.get_test_loc('false_positive/false-positive-gpl3.txt') + matches = idx.match(location=query_location) + assert not matches +