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

Unified Diff: test/intl/break-iterator/zh-break.js

Issue 148883002: Synchronize with r15594. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 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 | « test/intl/break-iterator/wellformed-unsupported-locale.js ('k') | test/intl/collator/de-sort.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/intl/break-iterator/zh-break.js
diff --git a/test/mjsunit/regress/negative_lookup.js b/test/intl/break-iterator/zh-break.js
similarity index 60%
copy from test/mjsunit/regress/negative_lookup.js
copy to test/intl/break-iterator/zh-break.js
index e23e365fc7ca2add2c3d950157ad56269669e276..c8434b10c2f145267e2d07a604f79eb05f187c9b 100644
--- a/test/mjsunit/regress/negative_lookup.js
+++ b/test/intl/break-iterator/zh-break.js
@@ -25,41 +25,39 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-function s(v) {
- v.x = 1;
-}
-
-function c(p) {
- return {__proto__: p};
-}
+// Segment plain Chinese sentence and check results.
-var p = {};
+var iterator = new Intl.v8BreakIterator(['zh']);
-// Make p the last prototype in the chain.
-p.__proto__ = null;
+var textToSegment = '\u56FD\u52A1\u9662\u5173\u4E8E\u300A\u571F\u5730' +
+ '\u623F\u5C4B\u7BA1\u7406\u6761\u4F8B\u300B';
+iterator.adoptText(textToSegment);
-var o1 = c(p);
-var o2 = c(p);
-var o3 = c(p);
-var o4 = c(p);
+var slices = [];
+var types = [];
+var pos = iterator.first();
+while (pos !== -1) {
+ var nextPos = iterator.next();
+ if (nextPos === -1) break;
-// Make y go to slow mode.
-// Do this after using p as prototype, since using an object as prototype kicks
-// it back into fast mode.
-p.y = 1;
-delete p.y;
+ slices.push(textToSegment.slice(pos, nextPos));
+ types.push(iterator.breakType());
-// Initialize the store IC.
-s(o1);
-s(o2);
-
-// Do something with x in slow-mode p.
-Object.defineProperty(p, "x", { writable: false, value: 5 });
-
-// Verify that directly setting x fails.
-o3.x = 10;
-assertEquals(5, o3.x);
+ pos = nextPos;
+}
-// Verify that setting x through the IC fails.
-s(o4);
-assertEquals(5, o4.x);
+assertEquals('\u56FD\u52A1\u9662', slices[0]);
+assertEquals('\u5173\u4E8E', slices[1]);
+assertEquals('\u300A', slices[2]);
+assertEquals('\u571F\u5730', slices[3]);
+assertEquals('\u623F\u5C4B', slices[4]);
+assertEquals('\u7BA1\u7406', slices[5]);
+assertEquals('\u6761\u4F8B', slices[6]);
+assertEquals('\u300B', slices[7]);
+
+assertEquals('ideo', types[0]);
+assertEquals('ideo', types[1]);
+assertEquals('none', types[2]);
+assertEquals('ideo', types[3]);
+assertEquals('ideo', types[4]);
+assertEquals('none', types[types.length - 1]);
« no previous file with comments | « test/intl/break-iterator/wellformed-unsupported-locale.js ('k') | test/intl/collator/de-sort.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698