diff --git a/implementation-contributed/v8/intl/segmenter/segment-grapheme-following.js b/test/intl402/Segmenter/prototype/segment/segment-grapheme-following.js similarity index 81% rename from implementation-contributed/v8/intl/segmenter/segment-grapheme-following.js rename to test/intl402/Segmenter/prototype/segment/segment-grapheme-following.js index 0a824c0fb344abcff6646de9ca3ce02c7b316fe2..6e533386b21d51f38a7336a41d255b5137e86d6c 100644 --- a/implementation-contributed/v8/intl/segmenter/segment-grapheme-following.js +++ b/test/intl402/Segmenter/prototype/segment/segment-grapheme-following.js @@ -1,8 +1,13 @@ // Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +// This code is governed by the BSD license found in the LICENSE file. -// Flags: --harmony-intl-segmenter +/*--- +esid: sec-Intl.Segmenter.prototype.segment +description: Verifies the behavior for the "segment" function of the Segmenter prototype object. +info: | + Intl.Segmenter.prototype.segment( string ) +features: [Intl.Segmenter] +---*/ const seg = new Intl.Segmenter([], {granularity: "grapheme"}) for (const text of [ @@ -27,12 +32,12 @@ for (const text of [ let prev = 0; let segments = []; while (!iter.following()) { - assertEquals(undefined, iter.breakType); - assertTrue(iter.position >= 0); - assertTrue(iter.position <= text.length); - assertTrue(iter.position > prev); + assert.sameValue(undefined, iter.breakType); + assert(iter.position >= 0); + assert(iter.position <= text.length); + assert(iter.position > prev); segments.push(text.substring(prev, iter.position)); prev = iter.position; } - assertEquals(text, segments.join("")); + assert.sameValue(text, segments.join("")); } diff --git a/implementation-contributed/v8/intl/segmenter/segment-grapheme-iterable.js b/test/intl402/Segmenter/prototype/segment/segment-grapheme-iterable.js similarity index 78% rename from implementation-contributed/v8/intl/segmenter/segment-grapheme-iterable.js rename to test/intl402/Segmenter/prototype/segment/segment-grapheme-iterable.js index 50cf5db57f0be73336150152238abd55c7adb3e0..41b693f35150584306daf398c38444324e1803e1 100644 --- a/implementation-contributed/v8/intl/segmenter/segment-grapheme-iterable.js +++ b/test/intl402/Segmenter/prototype/segment/segment-grapheme-iterable.js @@ -1,8 +1,13 @@ // Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +// This code is governed by the BSD license found in the LICENSE file. -// Flags: --harmony-intl-segmenter +/*--- +esid: sec-Intl.Segmenter.prototype.segment +description: Verifies the behavior for the "segment" function of the Segmenter prototype object. +info: | + Intl.Segmenter.prototype.segment( string ) +features: [Intl.Segmenter] +---*/ const seg = new Intl.Segmenter([], {granularity: "grapheme"}) for (const text of [ @@ -29,17 +34,17 @@ for (const text of [ let iter = seg.segment(text); let prev = 0; for (const v of seg.segment(text)) { - assertEquals(undefined, v.breakType); - assertEquals("string", typeof v.segment); - assertTrue(v.segment.length > 0); + assert.sameValue(undefined, v.breakType); + assert.sameValue("string", typeof v.segment); + assert(v.segment.length > 0); segments.push(v.segment); // manually advance the iter. assertFalse(iter.following()); - assertEquals(iter.breakType, v.breakType); - assertEquals(text.substring(prev, iter.position), v.segment); + assert.sameValue(iter.breakType, v.breakType); + assert.sameValue(text.substring(prev, iter.position), v.segment); prev = iter.position; } - assertTrue(iter.following()); - assertEquals(text, segments.join('')); + assert(iter.following()); + assert.sameValue(text, segments.join('')); } diff --git a/implementation-contributed/v8/intl/segmenter/segment-grapheme-next.js b/test/intl402/Segmenter/prototype/segment/segment-grapheme-next.js similarity index 81% rename from implementation-contributed/v8/intl/segmenter/segment-grapheme-next.js rename to test/intl402/Segmenter/prototype/segment/segment-grapheme-next.js index f9adc27c135ddbbf9995ca83784d8c8a3054a9b1..6a31f6866e76e4ba9fdd32ee7049e91219f15682 100644 --- a/implementation-contributed/v8/intl/segmenter/segment-grapheme-next.js +++ b/test/intl402/Segmenter/prototype/segment/segment-grapheme-next.js @@ -1,8 +1,13 @@ // Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +// This code is governed by the BSD license found in the LICENSE file. -// Flags: --harmony-intl-segmenter +/*--- +esid: sec-Intl.Segmenter.prototype.segment +description: Verifies the behavior for the "segment" function of the Segmenter prototype object. +info: | + Intl.Segmenter.prototype.segment( string ) +features: [Intl.Segmenter] +---*/ const seg = new Intl.Segmenter([], {granularity: "grapheme"}) for (const text of [ @@ -27,10 +32,10 @@ for (const text of [ let segments = []; for (let result = iter.next(); !result.done; result = iter.next()) { const v = result.value; - assertEquals(undefined, v.breakType); - assertEquals("string", typeof v.segment); - assertTrue(v.segment.length > 0); + assert.sameValue(undefined, v.breakType); + assert.sameValue("string", typeof v.segment); + assert(v.segment.length > 0); segments.push(v.segment); } - assertEquals(text, segments.join('')); + assert.sameValue(text, segments.join('')); } diff --git a/implementation-contributed/v8/intl/segmenter/segment-grapheme-preceding.js b/test/intl402/Segmenter/prototype/segment/segment-grapheme-preceding.js similarity index 78% rename from implementation-contributed/v8/intl/segmenter/segment-grapheme-preceding.js rename to test/intl402/Segmenter/prototype/segment/segment-grapheme-preceding.js index 0031c22d2db9f522993ac53e88c5892a1e0e4a44..78887b26f690f1181167e200c2ad6c9ffeaebb9c 100644 --- a/implementation-contributed/v8/intl/segmenter/segment-grapheme-preceding.js +++ b/test/intl402/Segmenter/prototype/segment/segment-grapheme-preceding.js @@ -1,8 +1,13 @@ // Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +// This code is governed by the BSD license found in the LICENSE file. -// Flags: --harmony-intl-segmenter +/*--- +esid: sec-Intl.Segmenter.prototype.segment +description: Verifies the behavior for the "segment" function of the Segmenter prototype object. +info: | + Intl.Segmenter.prototype.segment( string ) +features: [Intl.Segmenter] +---*/ const seg = new Intl.Segmenter([], {granularity: "grapheme"}) for (const text of [ @@ -27,18 +32,18 @@ for (const text of [ let prev = text.length; let segments = []; iter.preceding(prev) - assertEquals(undefined, iter.breakType) - assertTrue(iter.position >= 0); - assertTrue(iter.position < prev); + assert.sameValue(undefined, iter.breakType) + assert(iter.position >= 0); + assert(iter.position < prev); segments.push(text.substring(iter.position, prev)); prev = iter.position; while (!iter.preceding()) { - assertEquals(undefined, iter.breakType); - assertTrue(iter.position >= 0); - assertTrue(iter.position <= text.length); - assertTrue(iter.position < prev); + assert.sameValue(undefined, iter.breakType); + assert(iter.position >= 0); + assert(iter.position <= text.length); + assert(iter.position < prev); segments.push(text.substring(iter.position, prev)); prev = iter.position; } - assertEquals(text, segments.reverse().join("")); + assert.sameValue(text, segments.reverse().join("")); } diff --git a/implementation-contributed/v8/intl/segmenter/segment-grapheme.js b/test/intl402/Segmenter/prototype/segment/segment-grapheme.js similarity index 83% rename from implementation-contributed/v8/intl/segmenter/segment-grapheme.js rename to test/intl402/Segmenter/prototype/segment/segment-grapheme.js index 6b7e6eaf103dbe3e1a3be37c7487aa4a536b1d04..e10c03d4bd60aacd7a772e054eba17996f9c5b00 100644 --- a/implementation-contributed/v8/intl/segmenter/segment-grapheme.js +++ b/test/intl402/Segmenter/prototype/segment/segment-grapheme.js @@ -1,8 +1,13 @@ // Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +// This code is governed by the BSD license found in the LICENSE file. -// Flags: --harmony-intl-segmenter +/*--- +esid: sec-Intl.Segmenter.prototype.segment +description: Verifies the behavior for the "segment" function of the Segmenter prototype object. +info: | + Intl.Segmenter.prototype.segment( string ) +features: [Intl.Segmenter] +---*/ const seg = new Intl.Segmenter([], {granularity: "grapheme"}) for (const text of [ @@ -24,6 +29,6 @@ for (const text of [ "ë²•ì› â€œë‹¤ìŠ¤ 지분 처분권·수ìµê¶Œ ëª¨ë‘ MBê°€ ë³´ìœ â€", // Korean ]) { const iter = seg.segment(text); - assertEquals(undefined, iter.breakType); - assertEquals(0, iter.position); + assert.sameValue(undefined, iter.breakType); + assert.sameValue(0, iter.position); } diff --git a/implementation-contributed/v8/intl/segmenter/segment-line-following-modes.js b/test/intl402/Segmenter/prototype/segment/segment-line-following-modes.js similarity index 66% rename from implementation-contributed/v8/intl/segmenter/segment-line-following-modes.js rename to test/intl402/Segmenter/prototype/segment/segment-line-following-modes.js index 75e90f3bf41309ef635ec7eb627ecd88ee7e0f15..403468bacca1e4a22050c772d2a5a377c8313c97 100644 --- a/implementation-contributed/v8/intl/segmenter/segment-line-following-modes.js +++ b/test/intl402/Segmenter/prototype/segment/segment-line-following-modes.js @@ -1,8 +1,13 @@ // Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +// This code is governed by the BSD license found in the LICENSE file. -// Flags: --harmony-intl-segmenter +/*--- +esid: sec-Intl.Segmenter.prototype.segment +description: Verifies the behavior for the "segment" function of the Segmenter prototype object. +info: | + Intl.Segmenter.prototype.segment( string ) +features: [Intl.Segmenter] +---*/ let breakCounts = {}; for (const locale of ["en", "fr", "ja", "zh", "ko"]) { @@ -39,19 +44,19 @@ for (const locale of ["en", "fr", "ja", "zh", "ko"]) { } // In Japanese // Just test the break count in loose mode is greater than normal mode. -assertTrue(breakCounts["ja-loose"] > breakCounts["ja-normal"]); +assert(breakCounts["ja-loose"] > breakCounts["ja-normal"]); // and test the break count in normal mode is greater than strict mode. -assertTrue(breakCounts["ja-normal"] > breakCounts["ja-strict"]); +assert(breakCounts["ja-normal"] > breakCounts["ja-strict"]); // In Chinese // Just test the break count in loose mode is greater than normal mode. -assertTrue(breakCounts["zh-loose"] > breakCounts["zh-normal"]); +assert(breakCounts["zh-loose"] > breakCounts["zh-normal"]); // and test the break count in normal mode is greater than strict mode. -assertTrue(breakCounts["zh-normal"] > breakCounts["zh-strict"]); +assert(breakCounts["zh-normal"] > breakCounts["zh-strict"]); // In English, French and Korean -assertEquals(breakCounts["en-loose"], breakCounts["en-normal"]); -assertEquals(breakCounts["fr-loose"], breakCounts["fr-normal"]); -assertEquals(breakCounts["ko-loose"], breakCounts["ko-normal"]); +assert.sameValue(breakCounts["en-loose"], breakCounts["en-normal"]); +assert.sameValue(breakCounts["fr-loose"], breakCounts["fr-normal"]); +assert.sameValue(breakCounts["ko-loose"], breakCounts["ko-normal"]); // and test the break count in normal mode is greater than strict mode. -assertTrue(breakCounts["en-normal"] > breakCounts["en-strict"]); -assertTrue(breakCounts["fr-normal"] > breakCounts["fr-strict"]); -assertTrue(breakCounts["ko-normal"] > breakCounts["ko-strict"]); +assert(breakCounts["en-normal"] > breakCounts["en-strict"]); +assert(breakCounts["fr-normal"] > breakCounts["fr-strict"]); +assert(breakCounts["ko-normal"] > breakCounts["ko-strict"]); diff --git a/implementation-contributed/v8/intl/segmenter/segment-line-following.js b/test/intl402/Segmenter/prototype/segment/segment-line-following.js similarity index 80% rename from implementation-contributed/v8/intl/segmenter/segment-line-following.js rename to test/intl402/Segmenter/prototype/segment/segment-line-following.js index 010f1cf7bb7daa1e79d82805e535c761884b93c6..16d5144addb1dbb69a33335d0d52596036dcfb2e 100644 --- a/implementation-contributed/v8/intl/segmenter/segment-line-following.js +++ b/test/intl402/Segmenter/prototype/segment/segment-line-following.js @@ -1,8 +1,13 @@ // Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +// This code is governed by the BSD license found in the LICENSE file. -// Flags: --harmony-intl-segmenter +/*--- +esid: sec-Intl.Segmenter.prototype.segment +description: Verifies the behavior for the "segment" function of the Segmenter prototype object. +info: | + Intl.Segmenter.prototype.segment( string ) +features: [Intl.Segmenter] +---*/ const seg = new Intl.Segmenter([], {granularity: "line"}) for (const text of [ @@ -27,12 +32,12 @@ for (const text of [ let prev = 0; let segments = []; while (!iter.following()) { - assertTrue(["soft", "hard"].includes(iter.breakType), iter.breakType); - assertTrue(iter.position >= 0); - assertTrue(iter.position <= text.length); - assertTrue(iter.position > prev); + assert(["soft", "hard"].includes(iter.breakType), iter.breakType); + assert(iter.position >= 0); + assert(iter.position <= text.length); + assert(iter.position > prev); segments.push(text.substring(prev, iter.position)); prev = iter.position; } - assertEquals(text, segments.join("")); + assert.sameValue(text, segments.join("")); } diff --git a/implementation-contributed/v8/intl/segmenter/segment-line-iterable.js b/test/intl402/Segmenter/prototype/segment/segment-line-iterable.js similarity index 78% rename from implementation-contributed/v8/intl/segmenter/segment-line-iterable.js rename to test/intl402/Segmenter/prototype/segment/segment-line-iterable.js index 0fb682c37e01f62194a4b703d0c7f97472fa5fa5..88dd9349da53266f1e426d04c6fad1aae2c225da 100644 --- a/implementation-contributed/v8/intl/segmenter/segment-line-iterable.js +++ b/test/intl402/Segmenter/prototype/segment/segment-line-iterable.js @@ -1,8 +1,13 @@ // Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +// This code is governed by the BSD license found in the LICENSE file. -// Flags: --harmony-intl-segmenter +/*--- +esid: sec-Intl.Segmenter.prototype.segment +description: Verifies the behavior for the "segment" function of the Segmenter prototype object. +info: | + Intl.Segmenter.prototype.segment( string ) +features: [Intl.Segmenter] +---*/ const seg = new Intl.Segmenter([], {granularity: "line"}) for (const text of [ @@ -29,17 +34,17 @@ for (const text of [ let iter = seg.segment(text); let prev = 0; for (const v of seg.segment(text)) { - assertTrue(["soft", "hard"].includes(v.breakType), v.breakType); - assertEquals("string", typeof v.segment); - assertTrue(v.segment.length > 0); + assert(["soft", "hard"].includes(v.breakType), v.breakType); + assert.sameValue("string", typeof v.segment); + assert(v.segment.length > 0); segments.push(v.segment); // manually advance the iter. assertFalse(iter.following()); - assertEquals(iter.breakType, v.breakType); - assertEquals(text.substring(prev, iter.position), v.segment); + assert.sameValue(iter.breakType, v.breakType); + assert.sameValue(text.substring(prev, iter.position), v.segment); prev = iter.position; } - assertTrue(iter.following()); - assertEquals(text, segments.join('')); + assert(iter.following()); + assert.sameValue(text, segments.join('')); } diff --git a/implementation-contributed/v8/intl/segmenter/segment-line-next.js b/test/intl402/Segmenter/prototype/segment/segment-line-next.js similarity index 81% rename from implementation-contributed/v8/intl/segmenter/segment-line-next.js rename to test/intl402/Segmenter/prototype/segment/segment-line-next.js index ecfb7eca82bdbfb3ceda0e0f06ec506c0e9282fa..01cd79a61d60f21c53641a28e7d879c870a79b08 100644 --- a/implementation-contributed/v8/intl/segmenter/segment-line-next.js +++ b/test/intl402/Segmenter/prototype/segment/segment-line-next.js @@ -1,8 +1,13 @@ // Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +// This code is governed by the BSD license found in the LICENSE file. -// Flags: --harmony-intl-segmenter +/*--- +esid: sec-Intl.Segmenter.prototype.segment +description: Verifies the behavior for the "segment" function of the Segmenter prototype object. +info: | + Intl.Segmenter.prototype.segment( string ) +features: [Intl.Segmenter] +---*/ const seg = new Intl.Segmenter([], {granularity: "line"}) for (const text of [ @@ -27,10 +32,10 @@ for (const text of [ let segments = []; for (let result = iter.next(); !result.done; result = iter.next()) { const v = result.value; - assertTrue(["soft", "hard"].includes(iter.breakType), iter.breakType); - assertEquals("string", typeof v.segment); - assertTrue(v.segment.length > 0); + assert(["soft", "hard"].includes(iter.breakType), iter.breakType); + assert.sameValue("string", typeof v.segment); + assert(v.segment.length > 0); segments.push(v.segment); } - assertEquals(text, segments.join('')); + assert.sameValue(text, segments.join('')); } diff --git a/implementation-contributed/v8/intl/segmenter/segment-line-preceding.js b/test/intl402/Segmenter/prototype/segment/segment-line-preceding.js similarity index 77% rename from implementation-contributed/v8/intl/segmenter/segment-line-preceding.js rename to test/intl402/Segmenter/prototype/segment/segment-line-preceding.js index 3491a21b9b566acf50261d05e87da9869a98f03d..1819cb18f7157e79099bd40347860ec8b268f954 100644 --- a/implementation-contributed/v8/intl/segmenter/segment-line-preceding.js +++ b/test/intl402/Segmenter/prototype/segment/segment-line-preceding.js @@ -1,8 +1,13 @@ // Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +// This code is governed by the BSD license found in the LICENSE file. -// Flags: --harmony-intl-segmenter +/*--- +esid: sec-Intl.Segmenter.prototype.segment +description: Verifies the behavior for the "segment" function of the Segmenter prototype object. +info: | + Intl.Segmenter.prototype.segment( string ) +features: [Intl.Segmenter] +---*/ const seg = new Intl.Segmenter([], {granularity: "line"}) for (const text of [ @@ -27,18 +32,18 @@ for (const text of [ let prev = text.length; let segments = []; iter.preceding(prev) - assertTrue(["soft", "hard"].includes(iter.breakType), iter.breakType); - assertTrue(iter.position >= 0); - assertTrue(iter.position < prev); + assert(["soft", "hard"].includes(iter.breakType), iter.breakType); + assert(iter.position >= 0); + assert(iter.position < prev); segments.push(text.substring(iter.position, prev)); prev = iter.position; while (!iter.preceding()) { - assertTrue(["soft", "hard"].includes(iter.breakType), iter.breakType); - assertTrue(iter.position >= 0); - assertTrue(iter.position <= text.length); - assertTrue(iter.position < prev); + assert(["soft", "hard"].includes(iter.breakType), iter.breakType); + assert(iter.position >= 0); + assert(iter.position <= text.length); + assert(iter.position < prev); segments.push(text.substring(iter.position, prev)); prev = iter.position; } - assertEquals(text, segments.reverse().join("")); + assert.sameValue(text, segments.reverse().join("")); } diff --git a/implementation-contributed/v8/intl/segmenter/segment-line.js b/test/intl402/Segmenter/prototype/segment/segment-line.js similarity index 83% rename from implementation-contributed/v8/intl/segmenter/segment-line.js rename to test/intl402/Segmenter/prototype/segment/segment-line.js index cbaa44356fcdb3e3dae07b10c6d66092b70088c4..7ad7262eb3461c211315dde4cf155a5a9f9b2b58 100644 --- a/implementation-contributed/v8/intl/segmenter/segment-line.js +++ b/test/intl402/Segmenter/prototype/segment/segment-line.js @@ -1,8 +1,13 @@ // Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +// This code is governed by the BSD license found in the LICENSE file. -// Flags: --harmony-intl-segmenter +/*--- +esid: sec-Intl.Segmenter.prototype.segment +description: Verifies the behavior for the "segment" function of the Segmenter prototype object. +info: | + Intl.Segmenter.prototype.segment( string ) +features: [Intl.Segmenter] +---*/ const seg = new Intl.Segmenter([], {granularity: "line"}) for (const text of [ @@ -24,6 +29,6 @@ for (const text of [ "ë²•ì› â€œë‹¤ìŠ¤ 지분 처분권·수ìµê¶Œ ëª¨ë‘ MBê°€ ë³´ìœ â€", // Korean ]) { const iter = seg.segment(text); - assertTrue(["soft", "hard"].includes(iter.breakType), iter.breakType); - assertEquals(0, iter.position); + assert(["soft", "hard"].includes(iter.breakType), iter.breakType); + assert.sameValue(0, iter.position); } diff --git a/implementation-contributed/v8/intl/segmenter/segment-sentence-following.js b/test/intl402/Segmenter/prototype/segment/segment-sentence-following.js similarity index 80% rename from implementation-contributed/v8/intl/segmenter/segment-sentence-following.js rename to test/intl402/Segmenter/prototype/segment/segment-sentence-following.js index 4acae8ba3c0d2bdc6810c9a87eceb012fd0a0457..426ffaa0a24206d5bed759f6f0d75647497cde1d 100644 --- a/implementation-contributed/v8/intl/segmenter/segment-sentence-following.js +++ b/test/intl402/Segmenter/prototype/segment/segment-sentence-following.js @@ -1,8 +1,13 @@ // Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +// This code is governed by the BSD license found in the LICENSE file. -// Flags: --harmony-intl-segmenter +/*--- +esid: sec-Intl.Segmenter.prototype.segment +description: Verifies the behavior for the "segment" function of the Segmenter prototype object. +info: | + Intl.Segmenter.prototype.segment( string ) +features: [Intl.Segmenter] +---*/ const seg = new Intl.Segmenter([], {granularity: "sentence"}) for (const text of [ @@ -27,12 +32,12 @@ for (const text of [ let prev = 0; let segments = []; while (!iter.following()) { - assertTrue(["sep", "term"].includes(iter.breakType), iter.breakType); - assertTrue(iter.position >= 0); - assertTrue(iter.position <= text.length); - assertTrue(iter.position > prev); + assert(["sep", "term"].includes(iter.breakType), iter.breakType); + assert(iter.position >= 0); + assert(iter.position <= text.length); + assert(iter.position > prev); segments.push(text.substring(prev, iter.position)); prev = iter.position; } - assertEquals(text, segments.join("")); + assert.sameValue(text, segments.join("")); } diff --git a/implementation-contributed/v8/intl/segmenter/segment-sentence-iterable.js b/test/intl402/Segmenter/prototype/segment/segment-sentence-iterable.js similarity index 78% rename from implementation-contributed/v8/intl/segmenter/segment-sentence-iterable.js rename to test/intl402/Segmenter/prototype/segment/segment-sentence-iterable.js index 6bd3969c2b65f293e208d7b6b26f8019ed321cdd..b7596d3c9ca964f641d3329eef9d2bea9e7c2e53 100644 --- a/implementation-contributed/v8/intl/segmenter/segment-sentence-iterable.js +++ b/test/intl402/Segmenter/prototype/segment/segment-sentence-iterable.js @@ -1,8 +1,13 @@ // Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +// This code is governed by the BSD license found in the LICENSE file. -// Flags: --harmony-intl-segmenter +/*--- +esid: sec-Intl.Segmenter.prototype.segment +description: Verifies the behavior for the "segment" function of the Segmenter prototype object. +info: | + Intl.Segmenter.prototype.segment( string ) +features: [Intl.Segmenter] +---*/ const seg = new Intl.Segmenter([], {granularity: "sentence"}) for (const text of [ @@ -29,17 +34,17 @@ for (const text of [ let iter = seg.segment(text); let prev = 0; for (const v of seg.segment(text)) { - assertTrue(["sep", "term"].includes(v.breakType), v.breakType); - assertEquals("string", typeof v.segment); - assertTrue(v.segment.length > 0); + assert(["sep", "term"].includes(v.breakType), v.breakType); + assert.sameValue("string", typeof v.segment); + assert(v.segment.length > 0); segments.push(v.segment); // manually advance the iter. assertFalse(iter.following()); - assertEquals(iter.breakType, v.breakType); - assertEquals(text.substring(prev, iter.position), v.segment); + assert.sameValue(iter.breakType, v.breakType); + assert.sameValue(text.substring(prev, iter.position), v.segment); prev = iter.position; } - assertTrue(iter.following()); - assertEquals(text, segments.join('')); + assert(iter.following()); + assert.sameValue(text, segments.join('')); } diff --git a/implementation-contributed/v8/intl/segmenter/segment-sentence-next.js b/test/intl402/Segmenter/prototype/segment/segment-sentence-next.js similarity index 81% rename from implementation-contributed/v8/intl/segmenter/segment-sentence-next.js rename to test/intl402/Segmenter/prototype/segment/segment-sentence-next.js index 071f00cfdfa8a3762d72750427db5e0ab09a37d6..41492252f853115b05563b4c1f8232364431c0e3 100644 --- a/implementation-contributed/v8/intl/segmenter/segment-sentence-next.js +++ b/test/intl402/Segmenter/prototype/segment/segment-sentence-next.js @@ -1,8 +1,13 @@ // Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +// This code is governed by the BSD license found in the LICENSE file. -// Flags: --harmony-intl-segmenter +/*--- +esid: sec-Intl.Segmenter.prototype.segment +description: Verifies the behavior for the "segment" function of the Segmenter prototype object. +info: | + Intl.Segmenter.prototype.segment( string ) +features: [Intl.Segmenter] +---*/ const seg = new Intl.Segmenter([], {granularity: "sentence"}) for (const text of [ @@ -27,10 +32,10 @@ for (const text of [ let segments = []; for (let result = iter.next(); !result.done; result = iter.next()) { const v = result.value; - assertTrue(["sep", "term"].includes(iter.breakType), iter.breakType); - assertEquals("string", typeof v.segment); - assertTrue(v.segment.length > 0); + assert(["sep", "term"].includes(iter.breakType), iter.breakType); + assert.sameValue("string", typeof v.segment); + assert(v.segment.length > 0); segments.push(v.segment); } - assertEquals(text, segments.join('')); + assert.sameValue(text, segments.join('')); } diff --git a/implementation-contributed/v8/intl/segmenter/segment-sentence-preceding.js b/test/intl402/Segmenter/prototype/segment/segment-sentence-preceding.js similarity index 77% rename from implementation-contributed/v8/intl/segmenter/segment-sentence-preceding.js rename to test/intl402/Segmenter/prototype/segment/segment-sentence-preceding.js index 291b315312b7e3b6c38d4dc7e50a29042732333c..cdb41402cfb14a9af031c949693afcfbcd9701d4 100644 --- a/implementation-contributed/v8/intl/segmenter/segment-sentence-preceding.js +++ b/test/intl402/Segmenter/prototype/segment/segment-sentence-preceding.js @@ -1,8 +1,13 @@ // Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +// This code is governed by the BSD license found in the LICENSE file. -// Flags: --harmony-intl-segmenter +/*--- +esid: sec-Intl.Segmenter.prototype.segment +description: Verifies the behavior for the "segment" function of the Segmenter prototype object. +info: | + Intl.Segmenter.prototype.segment( string ) +features: [Intl.Segmenter] +---*/ const seg = new Intl.Segmenter([], {granularity: "sentence"}) for (const text of [ @@ -27,18 +32,18 @@ for (const text of [ let prev = text.length; let segments = []; iter.preceding(prev); - assertTrue(["sep", "term"].includes(iter.breakType), iter.breakType); - assertTrue(iter.position >= 0); - assertTrue(iter.position < prev); + assert(["sep", "term"].includes(iter.breakType), iter.breakType); + assert(iter.position >= 0); + assert(iter.position < prev); segments.push(text.substring(iter.position, prev)); prev = iter.position; while (!iter.preceding()) { - assertTrue(["sep", "term"].includes(iter.breakType), iter.breakType); - assertTrue(iter.position >= 0); - assertTrue(iter.position <= text.length); - assertTrue(iter.position < prev); + assert(["sep", "term"].includes(iter.breakType), iter.breakType); + assert(iter.position >= 0); + assert(iter.position <= text.length); + assert(iter.position < prev); segments.push(text.substring(iter.position, prev)); prev = iter.position; } - assertEquals(text, segments.reverse().join("")); + assert.sameValue(text, segments.reverse().join("")); } diff --git a/implementation-contributed/v8/intl/segmenter/segment-sentence.js b/test/intl402/Segmenter/prototype/segment/segment-sentence.js similarity index 83% rename from implementation-contributed/v8/intl/segmenter/segment-sentence.js rename to test/intl402/Segmenter/prototype/segment/segment-sentence.js index b258d61998b557efc29ece5c708c187ed894ebf4..3ba03f574606bb6a05b19fcbda9b7d1862c3c197 100644 --- a/implementation-contributed/v8/intl/segmenter/segment-sentence.js +++ b/test/intl402/Segmenter/prototype/segment/segment-sentence.js @@ -1,8 +1,13 @@ // Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +// This code is governed by the BSD license found in the LICENSE file. -// Flags: --harmony-intl-segmenter +/*--- +esid: sec-Intl.Segmenter.prototype.segment +description: Verifies the behavior for the "segment" function of the Segmenter prototype object. +info: | + Intl.Segmenter.prototype.segment( string ) +features: [Intl.Segmenter] +---*/ const seg = new Intl.Segmenter([], {granularity: "sentence"}) for (const text of [ @@ -24,6 +29,6 @@ for (const text of [ "ë²•ì› â€œë‹¤ìŠ¤ 지분 처분권·수ìµê¶Œ ëª¨ë‘ MBê°€ ë³´ìœ â€", // Korean ]) { const iter = seg.segment(text); - assertTrue(["sep", "term"].includes(iter.breakType), iter.breakType); - assertEquals(0, iter.position); + assert(["sep", "term"].includes(iter.breakType), iter.breakType); + assert.sameValue(0, iter.position); } diff --git a/implementation-contributed/v8/intl/segmenter/segment-word-following.js b/test/intl402/Segmenter/prototype/segment/segment-word-following.js similarity index 80% rename from implementation-contributed/v8/intl/segmenter/segment-word-following.js rename to test/intl402/Segmenter/prototype/segment/segment-word-following.js index 5f2872e58179a3d14f0700fd5455dcc9ee193918..6609acd05c1b1c44cbe07d0c845c5508ccf3ab02 100644 --- a/implementation-contributed/v8/intl/segmenter/segment-word-following.js +++ b/test/intl402/Segmenter/prototype/segment/segment-word-following.js @@ -1,8 +1,13 @@ // Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +// This code is governed by the BSD license found in the LICENSE file. -// Flags: --harmony-intl-segmenter +/*--- +esid: sec-Intl.Segmenter.prototype.segment +description: Verifies the behavior for the "segment" function of the Segmenter prototype object. +info: | + Intl.Segmenter.prototype.segment( string ) +features: [Intl.Segmenter] +---*/ const seg = new Intl.Segmenter([], {granularity: "word"}) for (const text of [ @@ -27,12 +32,12 @@ for (const text of [ let prev = 0; let segments = []; while (!iter.following()) { - assertTrue(["word", "none"].includes(iter.breakType), iter.breakType); - assertTrue(iter.position >= 0); - assertTrue(iter.position <= text.length); - assertTrue(iter.position > prev); + assert(["word", "none"].includes(iter.breakType), iter.breakType); + assert(iter.position >= 0); + assert(iter.position <= text.length); + assert(iter.position > prev); segments.push(text.substring(prev, iter.position)); prev = iter.position; } - assertEquals(text, segments.join("")); + assert.sameValue(text, segments.join("")); } diff --git a/implementation-contributed/v8/intl/segmenter/segment-word-iterable.js b/test/intl402/Segmenter/prototype/segment/segment-word-iterable.js similarity index 78% rename from implementation-contributed/v8/intl/segmenter/segment-word-iterable.js rename to test/intl402/Segmenter/prototype/segment/segment-word-iterable.js index 120f46842dc2ae5a951f693c23f2c99f0f3e9ed3..d28f0489a7b145a3e0ed408b27d30dda89ce3587 100644 --- a/implementation-contributed/v8/intl/segmenter/segment-word-iterable.js +++ b/test/intl402/Segmenter/prototype/segment/segment-word-iterable.js @@ -1,8 +1,13 @@ // Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +// This code is governed by the BSD license found in the LICENSE file. -// Flags: --harmony-intl-segmenter +/*--- +esid: sec-Intl.Segmenter.prototype.segment +description: Verifies the behavior for the "segment" function of the Segmenter prototype object. +info: | + Intl.Segmenter.prototype.segment( string ) +features: [Intl.Segmenter] +---*/ const seg = new Intl.Segmenter([], {granularity: "word"}) for (const text of [ @@ -29,17 +34,17 @@ for (const text of [ let iter = seg.segment(text); let prev = 0; for (const v of seg.segment(text)) { - assertTrue(["word", "none"].includes(v.breakType), v.breakType); - assertEquals("string", typeof v.segment); - assertTrue(v.segment.length > 0); + assert(["word", "none"].includes(v.breakType), v.breakType); + assert.sameValue("string", typeof v.segment); + assert(v.segment.length > 0); segments.push(v.segment); // manually advance the iter. assertFalse(iter.following()); - assertEquals(iter.breakType, v.breakType); - assertEquals(text.substring(prev, iter.position), v.segment); + assert.sameValue(iter.breakType, v.breakType); + assert.sameValue(text.substring(prev, iter.position), v.segment); prev = iter.position; } - assertTrue(iter.following()); - assertEquals(text, segments.join('')); + assert(iter.following()); + assert.sameValue(text, segments.join('')); } diff --git a/implementation-contributed/v8/intl/segmenter/segment-word-next.js b/test/intl402/Segmenter/prototype/segment/segment-word-next.js similarity index 81% rename from implementation-contributed/v8/intl/segmenter/segment-word-next.js rename to test/intl402/Segmenter/prototype/segment/segment-word-next.js index a88e9366ef5caf4e6b642a8402501c2e7af5ee38..27bed472789a16dfcb34026fd7a5bcae7bd6b0d0 100644 --- a/implementation-contributed/v8/intl/segmenter/segment-word-next.js +++ b/test/intl402/Segmenter/prototype/segment/segment-word-next.js @@ -1,8 +1,13 @@ // Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +// This code is governed by the BSD license found in the LICENSE file. -// Flags: --harmony-intl-segmenter +/*--- +esid: sec-Intl.Segmenter.prototype.segment +description: Verifies the behavior for the "segment" function of the Segmenter prototype object. +info: | + Intl.Segmenter.prototype.segment( string ) +features: [Intl.Segmenter] +---*/ const seg = new Intl.Segmenter([], {granularity: "word"}) for (const text of [ @@ -27,10 +32,10 @@ for (const text of [ let segments = []; for (let result = iter.next(); !result.done; result = iter.next()) { const v = result.value; - assertTrue(["word", "none"].includes(iter.breakType), iter.breakType); - assertEquals("string", typeof v.segment); - assertTrue(v.segment.length > 0); + assert(["word", "none"].includes(iter.breakType), iter.breakType); + assert.sameValue("string", typeof v.segment); + assert(v.segment.length > 0); segments.push(v.segment); } - assertEquals(text, segments.join('')); + assert.sameValue(text, segments.join('')); } diff --git a/implementation-contributed/v8/intl/segmenter/segment-word-preceding.js b/test/intl402/Segmenter/prototype/segment/segment-word-preceding.js similarity index 77% rename from implementation-contributed/v8/intl/segmenter/segment-word-preceding.js rename to test/intl402/Segmenter/prototype/segment/segment-word-preceding.js index fee750f345d8d96e10a819ba7cfb8b7562290310..ddff70c710534edc8cccb8a3c68ade452277641d 100644 --- a/implementation-contributed/v8/intl/segmenter/segment-word-preceding.js +++ b/test/intl402/Segmenter/prototype/segment/segment-word-preceding.js @@ -1,8 +1,13 @@ // Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +// This code is governed by the BSD license found in the LICENSE file. -// Flags: --harmony-intl-segmenter +/*--- +esid: sec-Intl.Segmenter.prototype.segment +description: Verifies the behavior for the "segment" function of the Segmenter prototype object. +info: | + Intl.Segmenter.prototype.segment( string ) +features: [Intl.Segmenter] +---*/ const seg = new Intl.Segmenter([], {granularity: "word"}) for (const text of [ @@ -27,18 +32,18 @@ for (const text of [ let prev = text.length; let segments = []; iter.preceding(prev); - assertTrue(["word", "none"].includes(iter.breakType), iter.breakType); - assertTrue(iter.position >= 0); - assertTrue(iter.position < prev); + assert(["word", "none"].includes(iter.breakType), iter.breakType); + assert(iter.position >= 0); + assert(iter.position < prev); segments.push(text.substring(iter.position, prev)); prev = iter.position; while (!iter.preceding()) { - assertTrue(["word", "none"].includes(iter.breakType), iter.breakType); - assertTrue(iter.position >= 0); - assertTrue(iter.position <= text.length); - assertTrue(iter.position < prev); + assert(["word", "none"].includes(iter.breakType), iter.breakType); + assert(iter.position >= 0); + assert(iter.position <= text.length); + assert(iter.position < prev); segments.push(text.substring(iter.position, prev)); prev = iter.position; } - assertEquals(text, segments.reverse().join("")); + assert.sameValue(text, segments.reverse().join("")); } diff --git a/implementation-contributed/v8/intl/segmenter/segment-word.js b/test/intl402/Segmenter/prototype/segment/segment-word.js similarity index 83% rename from implementation-contributed/v8/intl/segmenter/segment-word.js rename to test/intl402/Segmenter/prototype/segment/segment-word.js index 4c74fbee3c92d89223186434c8c175a879ababe7..935eadb38e852061f4dac276d7301199570d4a8a 100644 --- a/implementation-contributed/v8/intl/segmenter/segment-word.js +++ b/test/intl402/Segmenter/prototype/segment/segment-word.js @@ -1,8 +1,13 @@ // Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +// This code is governed by the BSD license found in the LICENSE file. -// Flags: --harmony-intl-segmenter +/*--- +esid: sec-Intl.Segmenter.prototype.segment +description: Verifies the behavior for the "segment" function of the Segmenter prototype object. +info: | + Intl.Segmenter.prototype.segment( string ) +features: [Intl.Segmenter] +---*/ const seg = new Intl.Segmenter([], {granularity: "word"}) for (const text of [ @@ -24,6 +29,6 @@ for (const text of [ "ë²•ì› â€œë‹¤ìŠ¤ 지분 처분권·수ìµê¶Œ ëª¨ë‘ MBê°€ ë³´ìœ â€", // Korean ]) { const iter = seg.segment(text); - assertTrue(["word", "none"].includes(iter.breakType), iter.breakType); - assertEquals(0, iter.position); + assert(["word", "none"].includes(iter.breakType), iter.breakType); + assert.sameValue(0, iter.position); }