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..2a0b6d7aaeb --- /dev/null +++ b/tests/licensedcode/data/false_positive/false-positive-gpl3.txt @@ -0,0 +1 @@ +S5PC100_GPL3(0) \ No newline at end of file diff --git a/tests/licensedcode/test_detect.py b/tests/licensedcode/test_detect.py index a99b7d61195..d61e034ec7b 100644 --- a/tests/licensedcode/test_detect.py +++ b/tests/licensedcode/test_detect.py @@ -1311,3 +1311,16 @@ 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() + expected = [] + + query_location = self.get_test_loc('false_positive/false-positive-gpl3.txt') + matches = idx.match(location=query_location) + + results = [m.rule.license_expression for m in matches] + + assert results == expected +