Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/src/license_detection/license_detector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ List<LicenseMatch> removeOverLappingMatches(List<LicenseMatch> matches) {
// Retain both the licenses in case of an exact match,
// so that it can be resolved by the user.
if (aConf > bConf) {
proposals[j] = true;
proposals[j] = false;
} else if (bConf > aConf) {
keep = false;
}
Expand Down
9 changes: 1 addition & 8 deletions test/license_detector_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void main() {
);

_testOverLappingMatches(
name: 'Does not discard match contained in other with less token density',
name: 'discard a match contained in other with less token density',
input: [
_dummyLicenseMatchInstance(
1,
Expand All @@ -146,13 +146,6 @@ void main() {
_dummyLicenseMatchInstance(0.65, 'matchC', start: 140, end: 200),
],
expected: [
_dummyLicenseMatchInstance(
1,
'matchB',
start: 5,
end: 95,
tokensClaimed: 75,
),
_dummyLicenseMatchInstance(
0.9,
'matchA',
Expand Down
8 changes: 4 additions & 4 deletions test/licenses/license_coverage_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ void main() {
license.content,
relativePath: 'LICENSE',
);
final match = detected
.where((l) => l.spdxIdentifier == license.identifier)
.single;

// should only match the same license
expect(detected, hasLength(1));
final match = detected.single;
expect(match.spdxIdentifier, license.identifier);
expect(match.range!.coverages, hasLength(2));
}
});
Expand Down
Loading