]> granicus.if.org Git - icu/commitdiff
ICU-12549 Adding coverage for SpoofChecker.Builder copy constructor
authorShane Carr <shane@unicode.org>
Thu, 15 Sep 2016 21:17:07 +0000 (21:17 +0000)
committerShane Carr <shane@unicode.org>
Thu, 15 Sep 2016 21:17:07 +0000 (21:17 +0000)
X-SVN-Rev: 39247

icu4j/main/tests/core/src/com/ibm/icu/dev/test/text/SpoofCheckerTest.java

index 9c58ba3666b605e2f301896e29b3f4f22c2c3883..18bd7b59050f12e2b7f1419185ae9ebeffe90b5e 100644 (file)
@@ -829,4 +829,14 @@ public class SpoofCheckerTest extends TestFmwk {
             fail("Failed while testing ScriptSet: " + e.getClass() + ": " + e.getMessage());
         }
     }
+
+    @Test
+    public void testCopyConstructor() {
+        SpoofChecker sc1 = new SpoofChecker.Builder()
+                .setAllowedChars(SpoofChecker.RECOMMENDED)
+                .setChecks(SpoofChecker.ALL_CHECKS &~ SpoofChecker.INVISIBLE)
+                .build();
+        SpoofChecker sc2 = new SpoofChecker.Builder(sc1).build();
+        assertEquals("Copy constructor should produce identical instances", sc1, sc2);
+    }
 }