Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(894)

Unified Diff: tests/StringTest.cpp

Issue 646213002: Eliminate one copy of replace_char() function. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add another test with some weird characters Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkString.cpp ('k') | tools/PictureRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/StringTest.cpp
diff --git a/tests/StringTest.cpp b/tests/StringTest.cpp
index 13ee5ec2153ff6da775bef64887fc16f759da2f4..4df421bce33ec95a574656140b7643084d1f2bc2 100644
--- a/tests/StringTest.cpp
+++ b/tests/StringTest.cpp
@@ -184,6 +184,20 @@ DEF_TEST(String, reporter) {
REPORTER_ASSERT(reporter, buffer[19] == 0);
REPORTER_ASSERT(reporter, buffer[20] == 'a');
+ SkString skia_2d("skia_2d");
+ SkString skia2d("skia-2d");
+ skia_2d.replace('_', '-');
+ REPORTER_ASSERT(reporter, skia_2d == skia2d);
+
+ SkString meat("meat");
+ SkString meet("meet");
+ meat.replace('a', 'e');
+ REPORTER_ASSERT(reporter, meat == meet);
+
+ SkString hangul("\xed\x95\x9c\xea\xb5\xad\xec\x96\xb4");
tfarina 2014/10/18 03:42:27 Mike, could you take another look? Let me know if
+ SkString hangul2("\xb4\x95\x9c\xea\xb5\xad\xec\x96\xb4");
+ hangul.replace('\xed', '\xb4');
+ REPORTER_ASSERT(reporter, hangul == hangul2);
}
DEF_TEST(String_SkStrSplit, r) {
« no previous file with comments | « src/core/SkString.cpp ('k') | tools/PictureRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698