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

Unified Diff: runtime/vm/object_test.cc

Issue 11412258: Use the code point iterator when computing 16-bit string hash codes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: bugfix Created 8 years, 1 month 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 | « runtime/vm/object.cc ('k') | runtime/vm/unicode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object_test.cc
diff --git a/runtime/vm/object_test.cc b/runtime/vm/object_test.cc
index 74b49c14dfcd51e9149a6a602ca8e6a466a5349f..f4b1c23dac4bd62376a58fe32fe8ba62aff06e5c 100644
--- a/runtime/vm/object_test.cc
+++ b/runtime/vm/object_test.cc
@@ -1694,6 +1694,23 @@ TEST_CASE(StringCodePointIterator) {
}
+TEST_CASE(StringCodePointIteratorRange) {
+ const String& str = String::Handle(String::New("foo bar baz"));
+
+ String::CodePointIterator it0(str, 3, 0);
+ EXPECT(!it0.Next());
+
+ String::CodePointIterator it1(str, 4, 3);
+ EXPECT(it1.Next());
+ EXPECT_EQ('b', it1.Current());
+ EXPECT(it1.Next());
+ EXPECT_EQ('a', it1.Current());
+ EXPECT(it1.Next());
+ EXPECT_EQ('r', it1.Current());
+ EXPECT(!it1.Next());
+}
+
+
TEST_CASE(GrowableObjectArray) {
const int kArrayLen = 5;
Smi& value = Smi::Handle();
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/unicode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698