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

Unified Diff: test/intl/collator/normalization.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/collator/en-sort.js ('k') | test/intl/collator/property-override.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/intl/collator/normalization.js
diff --git a/src/hydrogen-dce.h b/test/intl/collator/normalization.js
similarity index 53%
copy from src/hydrogen-dce.h
copy to test/intl/collator/normalization.js
index 19749f279a2e1cb632ba5a300033e5a9f038638f..8238f235a85e35b94c6e46083f3063a204ab35e0 100644
--- a/src/hydrogen-dce.h
+++ b/test/intl/collator/normalization.js
@@ -25,32 +25,32 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef V8_HYDROGEN_DCE_H_
-#define V8_HYDROGEN_DCE_H_
-
-#include "hydrogen.h"
-
-namespace v8 {
-namespace internal {
-
-
-class HDeadCodeEliminationPhase : public HPhase {
- public:
- explicit HDeadCodeEliminationPhase(HGraph* graph)
- : HPhase("H_Dead code elimination", graph) { }
-
- void Run() {
- MarkLiveInstructions();
- RemoveDeadInstructions();
- }
-
- private:
- bool MarkLive(HValue* ref, HValue* instr);
- void MarkLiveInstructions();
- void RemoveDeadInstructions();
-};
-
-
-} } // namespace v8::internal
-
-#endif // V8_HYDROGEN_DCE_H_
+// Make sure normalization is always on, and normalization flag is ignored.
+
+// We need a character with two combining marks, from two different classes,
+// to make ICU fail comparison without normalization (upper, lower accent).
+// We will just switch order of combining characters to try to induce failure.
+
+// FYI, this one wouldn't work, since both accents are from the same class:
+// http://unicode.org/cldr/utility/character.jsp?a=01DF
+
+// See http://demo.icu-project.org/icu-bin/nbrowser?t=&s=1E09&uv=0 and
+// http://unicode.org/cldr/utility/character.jsp?a=1E09 for character details.
+var toCompare = ['\u0063\u0327\u0301', '\u0063\u0301\u0327'];
+
+// Try with normalization off (as an option).
+var collator = Intl.Collator([], {normalization: false});
+// If we accepted normalization parameter, this would have failed.
+assertEquals(0, collator.compare(toCompare[0], toCompare[1]));
+assertFalse(collator.resolvedOptions().hasOwnProperty('normalization'));
+
+// Try with normalization off (as Unicode extension).
+collator = Intl.Collator(['de-u-kk-false']);
+// If we accepted normalization parameter, this would have failed.
+assertEquals(0, collator.compare(toCompare[0], toCompare[1]));
+assertFalse(collator.resolvedOptions().hasOwnProperty('normalization'));
+
+// Normalization is on by default.
+collator = Intl.Collator();
+assertEquals(0, collator.compare(toCompare[0], toCompare[1]));
+assertFalse(collator.resolvedOptions().hasOwnProperty('normalization'));
« no previous file with comments | « test/intl/collator/en-sort.js ('k') | test/intl/collator/property-override.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698