[gnome-maps/wip/mlundblad/fix-ci-locale] tests: Run tests with en_US locale




commit a5127de6c9bb94090ed67bf61f9d6c2b71dda36c
Author: Marcus Lundblad <ml update uu se>
Date:   Wed Jan 26 21:49:10 2022 +0100

    tests: Run tests with en_US locale
    
    The "C" locale behaves differently with GJS 1.71,
    so for now change to en_US.utf8 locale to get
    a more reliable behavior.

 tests/meson.build  |  2 +-
 tests/utilsTest.js | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/tests/meson.build b/tests/meson.build
index c42c8137..51a600f0 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -23,7 +23,7 @@ foreach test : tests
        args: ['-I', meson.source_root() + '/src/', '-I',
               meson.source_root() + '/tests/',
               'tests/@0@'.format(test)],
-       env:  ['LANG=C', 'LC_ALL=C']
+       env:  ['LANG=en_US.utf8', 'LC_ALL=en_US.utf8']
   )
 endforeach
 
diff --git a/tests/utilsTest.js b/tests/utilsTest.js
index 09fb180f..190b3247 100644
--- a/tests/utilsTest.js
+++ b/tests/utilsTest.js
@@ -88,22 +88,22 @@ function prettyDistanceTest() {
     JsUnit.assertEquals('2.4 km', Utils.prettyDistance(2400, false));
     JsUnit.assertEquals('123 m', Utils.prettyDistance(123, false));
     JsUnit.assertEquals('1 km', Utils.prettyDistance(1001, false));
-    JsUnit.assertEquals('1001 m', Utils.prettyDistance(1001, true));
+    JsUnit.assertEquals('1,001 m', Utils.prettyDistance(1001, true));
 
     // tests with imperial system, using override mock function
     Utils.getMeasurementSystem = function() { return Utils.IMPERIAL_SYSTEM; };
     JsUnit.assertEquals('1 mi', Utils.prettyDistance(1609, false));
     JsUnit.assertEquals('2.4 mi', Utils.prettyDistance(3900, false));
     JsUnit.assertEquals('0.3 mi', Utils.prettyDistance(440, false));
-    JsUnit.assertEquals('1000 ft', Utils.prettyDistance(304.8, false));
+    JsUnit.assertEquals('1,000 ft', Utils.prettyDistance(304.8, false));
     JsUnit.assertEquals('1 mi', Utils.prettyDistance(1610, false));
-    JsUnit.assertEquals('5282 ft', Utils.prettyDistance(1610, true));
+    JsUnit.assertEquals('5,282 ft', Utils.prettyDistance(1610, true));
 }
 
 function prettyPopulationTest() {
-    JsUnit.assertEquals('123456', Utils.prettyPopulation(123456));
-    JsUnit.assertEquals('1234567', Utils.prettyPopulation(1234567));
-    JsUnit.assertEquals('200000', Utils.prettyPopulation(200000));
+    JsUnit.assertEquals('123,456', Utils.prettyPopulation(123456));
+    JsUnit.assertEquals('1,234,567', Utils.prettyPopulation(1234567));
+    JsUnit.assertEquals('200,000', Utils.prettyPopulation(200000));
     JsUnit.assertEquals('1M', Utils.prettyPopulation(1000000));
     JsUnit.assertEquals('2.1M', Utils.prettyPopulation(2100000));
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]