Skip to content

Commit b9b0405

Browse files
authored
Merge pull request #38 from spdx/longdashes
Add thin space unicode character (U+2009) to the space normalization
2 parents 1773028 + 2fcff2e commit b9b0405

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>org.spdx</groupId>
66
<artifactId>java-spdx-library</artifactId>
7-
<version>0.0.7</version>
7+
<version>0.0.8-SNAPSHOT</version>
88
<packaging>jar</packaging>
99

1010
<name>java-spdx-library</name>

src/main/java/org/spdx/utility/compare/LicenseCompareHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public class LicenseCompareHelper {
122122

123123

124124
static final String DASHES_REGEX = "[\\u2012\\u2013\\u2014\\u2015]";
125-
static final Pattern SPACE_PATTERN = Pattern.compile("[\\u202F\\u2007\\u2060]");
125+
static final Pattern SPACE_PATTERN = Pattern.compile("[\\u202F\\u2007\\u2060\\u2009]");
126126
static final Pattern PER_CENT_PATTERN = Pattern.compile("per cent", Pattern.CASE_INSENSITIVE);
127127
static final Pattern COPYRIGHT_HOLDER_PATTERN = Pattern.compile("copyright holder", Pattern.CASE_INSENSITIVE);
128128
static final Pattern COPYRIGHT_HOLDERS_PATTERN = Pattern.compile("copyright holders", Pattern.CASE_INSENSITIVE);

src/test/java/org/spdx/utility/compare/LicenseCompareHelperTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,10 +632,11 @@ public void regressionTestZpl21() throws IOException, InvalidSPDXAnalysisExcepti
632632
DifferenceDescription result = LicenseCompareHelper.isTextStandardLicense(LicenseInfoFactory.getListedLicenseById("ZPL-2.1"), compareText);
633633
assertFalse(result.isDifferenceFound());
634634
}
635+
635636

636637
public void testSpaceNormalization() {
637-
String t1 = "This is a test of space";
638-
String t2 = "This is\u2060a\u2007test\u202Fof space";
638+
String t1 = "This is a test of space extra";
639+
String t2 = "This is\u2060a\u2007test\u202Fof space\u2009extra";
639640
assertTrue(LicenseCompareHelper.isLicenseTextEquivalent(t1, t2));
640641
}
641642

0 commit comments

Comments
 (0)