-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix JSP failures with scx * Prevent deva,beng from working; run spotless * Add exemplars as second example * Spotless * Fixes for Markus's review * Fix Bangla comment also
- Loading branch information
Showing
4 changed files
with
207 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
UnicodeJsps/src/test/java/org/unicode/jsptest/TestMultivalued.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package org.unicode.jsptest; | ||
|
||
import com.ibm.icu.text.UnicodeSet; | ||
import org.junit.jupiter.api.Test; | ||
import org.unicode.jsp.UnicodeSetUtilities; | ||
import org.unicode.unittest.TestFmwkMinusMinus; | ||
|
||
public class TestMultivalued extends TestFmwkMinusMinus { | ||
@Test | ||
public void TestScx1Script() { | ||
String unicodeSetString = "\\p{scx=deva}"; | ||
UnicodeSet parsed = UnicodeSetUtilities.parseUnicodeSet(unicodeSetString); | ||
|
||
UnicodeSet mustContain = new UnicodeSet("[ᳵ।]"); // one character B&D, other B&D&D&G&... | ||
assertTrue(unicodeSetString + " contains " + mustContain, parsed.containsAll(mustContain)); | ||
|
||
UnicodeSet mustNotContain = new UnicodeSet("[ক]"); // one Bangla character | ||
assertFalse( | ||
unicodeSetString + " !contains " + mustNotContain, | ||
parsed.containsAll(mustNotContain)); | ||
} | ||
|
||
@Test | ||
public void TestScxMulti() { | ||
String unicodeSetString = "\\p{scx=beng,deva}"; | ||
String exceptionMessage = null; | ||
try { | ||
UnicodeSet parsed = UnicodeSetUtilities.parseUnicodeSet(unicodeSetString); | ||
} catch (Exception e) { | ||
exceptionMessage = e.getMessage(); | ||
} | ||
assertEquals( | ||
"Expected exception", | ||
"Multivalued property values can't contain commas.", | ||
exceptionMessage); | ||
} | ||
|
||
@Test | ||
public void TestExemplars() { | ||
String unicodeSetString = "\\p{exem=da}"; | ||
UnicodeSet parsed = UnicodeSetUtilities.parseUnicodeSet(unicodeSetString); | ||
|
||
UnicodeSet mustContain = new UnicodeSet("[æ]"); | ||
assertTrue(unicodeSetString + " contains " + mustContain, parsed.containsAll(mustContain)); | ||
|
||
UnicodeSet mustNotContain = new UnicodeSet("[ç]"); | ||
assertFalse( | ||
unicodeSetString + " !contains " + mustNotContain, | ||
parsed.containsAll(mustNotContain)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.