|
@ -51,6 +51,17 @@ TEST( NfcTestString, Simple ) |
|
|
|
|
|
|
|
|
// removal of the r-with-caron let the remaining ogonek combine with the e to U+0119 (E WITH OGONEK)
|
|
|
// removal of the r-with-caron let the remaining ogonek combine with the e to U+0119 (E WITH OGONEK)
|
|
|
EXPECT_EQ( s.erase(11, 2).get(), "ÜberHäus\u0119" ); |
|
|
EXPECT_EQ( s.erase(11, 2).get(), "ÜberHäus\u0119" ); |
|
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE ( s.starts_with("Üb") ); |
|
|
|
|
|
EXPECT_FALSE( s.starts_with("Üx") ); |
|
|
|
|
|
EXPECT_TRUE ( s.ends_with("s\u0119") ); |
|
|
|
|
|
EXPECT_FALSE( s.ends_with("ss\u0119") ); |
|
|
|
|
|
|
|
|
|
|
|
EXPECT_EQ( s.find("Über"), 0u ); |
|
|
|
|
|
EXPECT_EQ( s.find("ber") , 2u ); |
|
|
|
|
|
EXPECT_EQ( s.find("über"), UTF8::nfc_string::npos ); |
|
|
|
|
|
EXPECT_EQ( s.find("Übel"), UTF8::nfc_string::npos ); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -58,4 +69,6 @@ TEST( NfcTestString, Exceptions ) |
|
|
{ |
|
|
{ |
|
|
pEp::nfc_string s; |
|
|
pEp::nfc_string s; |
|
|
EXPECT_THROW( s = "Meep\xc0\x80.", pEp::illegal_utf ); |
|
|
EXPECT_THROW( s = "Meep\xc0\x80.", pEp::illegal_utf ); |
|
|
|
|
|
EXPECT_THROW( s += '\377', pEp::illegal_utf ); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|