diff --git a/icu4c/source/test/intltest/itspoof.cpp b/icu4c/source/test/intltest/itspoof.cpp index ac7a14cbfed..8980eb1f673 100644 --- a/icu4c/source/test/intltest/itspoof.cpp +++ b/icu4c/source/test/intltest/itspoof.cpp @@ -90,6 +90,7 @@ void IntlTestSpoof::runIndexedTest( int32_t index, UBool exec, const char* &name TESTCASE_AUTO(testBug12153); TESTCASE_AUTO(testBug12825); TESTCASE_AUTO(testBug12815); + TESTCASE_AUTO(testBug13314_MixedNumbers); TESTCASE_AUTO_END; } @@ -682,4 +683,18 @@ void IntlTestSpoof::testBug12815() { TEST_ASSERT_SUCCESS(status); } +void IntlTestSpoof::testBug13314_MixedNumbers() { + UErrorCode status = U_ZERO_ERROR; + LocalUSpoofCheckerPointer sc(uspoof_open(&status)); + TEST_ASSERT_SUCCESS(status); + uspoof_setChecks(sc.getAlias(), USPOOF_ALL_CHECKS, &status); + TEST_ASSERT_SUCCESS(status); + int32_t failedChecks = uspoof_areConfusableUnicodeString(sc.getAlias(), u"列", u"列", &status); + TEST_ASSERT_SUCCESS(status); + assertEquals("The CJK strings should be confusable", USPOOF_SINGLE_SCRIPT_CONFUSABLE, failedChecks); + failedChecks = uspoof_check2UnicodeString(sc.getAlias(), u"3Ȝ", nullptr, &status); + TEST_ASSERT_SUCCESS(status); + assertEquals("The '33' string does not fail spoof", 0, failedChecks); +} + #endif /* !UCONFIG_NO_REGULAR_EXPRESSIONS && !UCONFIG_NO_NORMALIZATION && !UCONFIG_NO_FILE_IO */ diff --git a/icu4c/source/test/intltest/itspoof.h b/icu4c/source/test/intltest/itspoof.h index 614e4735e76..e7124bd6c41 100644 --- a/icu4c/source/test/intltest/itspoof.h +++ b/icu4c/source/test/intltest/itspoof.h @@ -50,6 +50,8 @@ public: void testBug12815(); + void testBug13314_MixedNumbers(); + // Internal function to run a single skeleton test case. void checkSkeleton(const USpoofChecker *sc, uint32_t flags, const char *input, const char *expected, int32_t lineNum);