From bdb0fb307f66d39c57eb0e076bb5a37060aa45b8 Mon Sep 17 00:00:00 2001
From: Adrian Heine <mail@adrianheine.de>
Date: Mon, 16 Jan 2017 23:03:30 +0100
Subject: [PATCH] Improve move_bidi test set

* Enable most in phantom
* Enable all in !phantom
* Disable two that trigger L1 which we don't do correctly currently
* Revert commit 5cc5d7f50efc7a016485f017a603c4fa2b035266 (L1 tests)
---
 test/test.js | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/test/test.js b/test/test.js
index c4941cfe..4853e670 100644
--- a/test/test.js
+++ b/test/test.js
@@ -2216,13 +2216,11 @@ function makeItWrapAfter(cm, pos) {
     cm.setSize(w);
     posTop = cm.charCoords(pos).top;
   }
-  // Firefox > 50 compresses a space when two spaces from different bidi spans meet
-  cm.setSize(w + 10);
 }
 
 function testMoveBidi(str) {
   testCM("move_bidi_" + str, function(cm) {
-    if (cm.getOption("inputStyle") != "textarea" || webkit || !cm.getOption("rtlMoveVisually")) return;
+    if (cm.getOption("inputStyle") != "textarea" || !cm.getOption("rtlMoveVisually")) return;
     cm.getScrollerElement().style.fontFamily = "monospace";
     makeItWrapAfter(cm, Pos(0, 5));
 
@@ -2285,26 +2283,37 @@ function testMoveBidi(str) {
   }, {value: str, lineWrapping: true})
 };
 
+// We don't correctly implement L1 UBA
+// See https://bugzilla.mozilla.org/show_bug.cgi?id=1331501
+// and https://bugs.chromium.org/p/chromium/issues/detail?id=673405
+/*
 testMoveBidi("Say ا ب جabj\nS");
-testMoveBidi("Όȝǝڪȉۥ״ۺ׆ɀҩۏ\nҳ");
+testMoveBidi("Sayyy ا ا ب ج");
+*/
+
+if (!phantom) {
+  testMoveBidi("Όȝǝڪȉۥ״ۺ׆ɀҩۏ\nҳ");
+  testMoveBidi("ŌӰтقȤ؁ƥ؅٣ĎȺ١\nϚ");
+  testMoveBidi("ٻоҤѕѽΩ־؉ïίքdz\nٵ");
+  testMoveBidi("؅؁ĆՕƿɁǞϮؠȩóć\nď");
+  testMoveBidi("RŨďңŪzϢŎƏԖڇڦ\nӈ");
+}
+
 testMoveBidi("ό׊۷٢ԜһОצЉيčǟ\nѩ");
 testMoveBidi("ۑÚҳҕڬġڹհяųKV\nr");
-testMoveBidi("ŌӰтقȤ؁ƥ؅٣ĎȺ١\nϚ");
-testMoveBidi("ٻоҤѕѽΩ־؉ïίքdz\nٵ");
-//testMoveBidi("Count Ù¡ Ù¢ Ù£ Ù¤");
-testMoveBidi("Sayyy ا ا ب ج");
-testMoveBidi("؅؁ĆՕƿɁǞϮؠȩóć\nď");
 testMoveBidi("źڻғúہ4ם1Ƞc1a\nԁ");
 testMoveBidi("ҒȨҟփƞ٦ԓȦڰғâƥ\nڤ");
 testMoveBidi("քմѧǮßپüŢҍҞўڳ\nӧ");
-testMoveBidi("RŨďңŪzϢŎƏԖڇڦ\nӈ");
 testMoveBidi("ϖسՉȏŧΔԛdžĎӟیڡ\nέ");
 testMoveBidi("۹ؼL۵ĺȧКԙػא7״\nم");
+
+//testMoveBidi("Count Ù¡ Ù¢ Ù£ Ù¤");
 //testMoveBidi("ӣאƦϰ؊ȓېÛوը٬ز\nϪ");
 //testMoveBidi("ҾճٳџIՖӻ٥׭֐؜ڏ\nێ");
 //testMoveBidi("ҬÓФ؜ڂį٦Ͽɓڐͳٵ\nՈ");
 //testMoveBidi("aѴNijȻهˇ҃ڱӧǻֵ\na");
 //testMoveBidi(" a٧ا٢ ب جa\nS");
+
 /*
 for (var i = 0; i < 5; ++i) {
   testMoveBidi(getString(12) + "\n" + getString(1));
-- 
GitLab