[Libreoffice-commits] core.git: uitest/writer_tests

David Tardon dtardon at redhat.com
Fri Oct 13 08:29:35 UTC 2017


 uitest/writer_tests/spellDialog.py |   20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

New commits:
commit a00520d3ccf762154c2332a3941e072a604ac7aa
Author: David Tardon <dtardon at redhat.com>
Date:   Fri Oct 13 09:31:26 2017 +0200

    don't assume concrete spelling substitutions
    
    E.g., on my F-27 with system hunspell 1.5.4, the substitutions are
    
    dogg -> dodgy
    catt -> cat
    frogg -> frog
    
    which causes the test to fail...
    
    Change-Id: I6d192fcc74629c2f3b9d4780576499c47de96b26

diff --git a/uitest/writer_tests/spellDialog.py b/uitest/writer_tests/spellDialog.py
index a5c2d5c7e7e2..9f69fc2c8fe3 100644
--- a/uitest/writer_tests/spellDialog.py
+++ b/uitest/writer_tests/spellDialog.py
@@ -4,6 +4,8 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 
+import re
+
 from uitest.framework import UITestCase
 from uitest.uihelper.common import get_state_as_dict
 
@@ -41,14 +43,14 @@ frogg catt dogg
 dogg catt
 frog, dogg, catt"""
 
-    TDF46852_CORRECTED = """\
-dog
-dog
-tact dog
-frog frog
-frog tact dog
-dog tact
-frog, dog, tact"""
+    TDF46852_REGEX = """\
+([a-z]+)
+\\1
+([a-z]+) \\1
+([a-z]+) \\3
+\\3 \\2 \\1
+\\1 \\2
+\\3, \\1, \\2"""
 
     def test_tdf46852(self):
         supported_locale = self.is_supported_locale("en", "US")
@@ -92,5 +94,5 @@ frog, dog, tact"""
                 )
             )
 
-        self.assertEqual(document.Text.getString(), self.TDF46852_CORRECTED)
+        self.assertTrue(re.match(self.TDF46852_REGEX, document.Text.getString()))
         


More information about the Libreoffice-commits mailing list