Index: tests/StringTest.cpp |
diff --git a/tests/StringTest.cpp b/tests/StringTest.cpp |
index 462fcfadafd58f4e2d8949fa504438a5869e99f0..c8c10e192554fa421e94b474bf5d207e664d37fc 100644 |
--- a/tests/StringTest.cpp |
+++ b/tests/StringTest.cpp |
@@ -192,3 +192,16 @@ static void TestString(skiatest::Reporter* reporter) { |
#include "TestClassDef.h" |
DEFINE_TESTCLASS("String", StringTestClass, TestString) |
+ |
+DEF_TEST(String_SkStrSplit, r) { |
+ SkTArray<SkString> results; |
+ |
+ SkStrSplit("a-_b_c-dee--f-_-_-g-", "-_", &results); |
+ REPORTER_ASSERT(r, results.count() == 6); |
+ REPORTER_ASSERT(r, results[0].equals("a")); |
+ REPORTER_ASSERT(r, results[1].equals("b")); |
+ REPORTER_ASSERT(r, results[2].equals("c")); |
+ REPORTER_ASSERT(r, results[3].equals("dee")); |
+ REPORTER_ASSERT(r, results[4].equals("f")); |
+ REPORTER_ASSERT(r, results[5].equals("g")); |
+} |