Skip to content

Commit 1e24b13

Browse files
committed
fixing test failure
- when i removed `2-aho` from matcher, then many test cases are failed
1 parent 491f3cd commit 1e24b13

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/licensedcode/detection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ def is_correct_detection(license_matches):
10721072
]
10731073

10741074
return (
1075-
all(matcher in ("1-hash", "1-spdx-id") for matcher in matchers)
1075+
all(matcher in ("1-hash", "1-spdx-id", "2-aho") for matcher in matchers)
10761076
and all(is_match_coverage_perfect)
10771077
)
10781078

tests/scancode/data/extra-words/extra_words.expected.json

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@
7373
"license_expression": "bsd-new",
7474
"license_expression_spdx": "BSD-3-Clause",
7575
"detection_count": 1,
76-
"detection_log": [
77-
"extra-words"
78-
],
76+
"detection_log": [],
7977
"reference_matches": [
8078
{
8179
"license_expression": "bsd-new",
@@ -127,9 +125,7 @@
127125
"rule_text": "Redistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\nRedistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright\nnotice, this list of conditions and the following disclaimer in the\ndocumentation and/or other materials provided with the distribution.\n\nNeither the name of nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES,\nINCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL\nTHE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\nBUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS\nOF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\nTORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE\nUSE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
128126
}
129127
],
130-
"detection_log": [
131-
"extra-words"
132-
],
128+
"detection_log": [],
133129
"identifier": "bsd_new-fbfc5955-0c63-4c98-2ce9-08e1e1796f50"
134130
}
135131
}
@@ -378,9 +374,7 @@
378374
"matched_text_diagnostics": "Redistribution and use in source and binary forms, with or without\r\nmodification, are permitted provided that the following conditions are met:\r\n\r\n* Redistributions of source code must retain the above copyright notice, this\r\n list of conditions and the following disclaimer.\r\n\r\n* Redistributions in binary form must reproduce the above copyright notice,\r\n this list of conditions and the following disclaimer in the documentation\r\n and/or other materials provided with the distribution.\r\n\r\n* Neither the name of [filesize] nor the names of its\r\n contributors may be used to endorse or promote products derived from\r\n this software without specific prior written permission.\r\n\r\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\r\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\r\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\r\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\r\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
379375
}
380376
],
381-
"detection_log": [
382-
"extra-words"
383-
],
377+
"detection_log": [],
384378
"identifier": "bsd_new-fbfc5955-0c63-4c98-2ce9-08e1e1796f50"
385379
}
386380
],

0 commit comments

Comments
 (0)