[geary/wip/composer-folks] Fix engine test failure under flatpak
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/composer-folks] Fix engine test failure under flatpak
- Date: Wed, 26 Jun 2019 01:49:53 +0000 (UTC)
commit 03ca9d7327a2d6e241c858442d682594ec9e07f8
Author: Michael Gratton <mike vee net>
Date: Mon Jun 24 21:00:51 2019 +1000
Fix engine test failure under flatpak
Geary.ImapDb.Database/utf8_case_insensitive_collation depends on a well
known UTF-8 collation order, but Flatpak doesn't ship C.UTF-8, so use
en_US.UTF-8 instead for the moment.
See https://gitlab.com/freedesktop-sdk/freedesktop-sdk/issues/812
test/engine/imap-db/imap-db-database-test.vala | 11 ++++++++++-
test/test-engine.vala | 12 ++++++++----
2 files changed, 18 insertions(+), 5 deletions(-)
---
diff --git a/test/engine/imap-db/imap-db-database-test.vala b/test/engine/imap-db/imap-db-database-test.vala
index 44a4845f..13574c61 100644
--- a/test/engine/imap-db/imap-db-database-test.vala
+++ b/test/engine/imap-db/imap-db-database-test.vala
@@ -147,7 +147,16 @@ class Geary.ImapDB.DatabaseTest : TestCase {
INSERT INTO Test (test_str) VALUES ('BB');
INSERT INTO Test (test_str) VALUES ('🤯');
""");
- string[] expected = { "a", "BB", "B", "🤯" };
+
+ string locale = GLib.Intl.setlocale(GLib.LocaleCategory.COLLATE);
+ // Flatpak does not currently ship C.UTF-8, so use en_US
+ // instead. See test-engine.vala and
+ // https://gitlab.com/freedesktop-sdk/freedesktop-sdk/issues/812
+ //
+ // This is the expected order under C.UTF-8:
+ // string[] expected = { "a", "BB", "B", "🤯" };
+ // This is the expected order under en_US.UTF-8:
+ string[] expected = { "BB", "B", "a", "🤯" };
Db.Result result = db.query(
"SELECT test_str FROM Test ORDER BY test_str COLLATE UTF8COLL DESC"
diff --git a/test/test-engine.vala b/test/test-engine.vala
index 55862bd5..2a2ca9c8 100644
--- a/test/test-engine.vala
+++ b/test/test-engine.vala
@@ -10,11 +10,15 @@ int main(string[] args) {
* Initialise all the things.
*/
- Test.init(ref args);
-
// Ensure things like e.g. GLib's formatting routines uses a
- // UTF-8-based locale rather ASCII
- GLib.Intl.setlocale(LocaleCategory.ALL, "C.UTF-8");
+ // well-known UTF-8-based locale rather ASCII.
+ //
+ // Flatpak does not currently ship C.UTF-8, so use another. See:
+ // https://gitlab.com/freedesktop-sdk/freedesktop-sdk/issues/812
+ // GLib.Intl.setlocale(LocaleCategory.ALL, "C.UTF-8");
+ GLib.Intl.setlocale(LocaleCategory.ALL, "en_US.UTF-8");
+
+ Test.init(ref args);
Geary.RFC822.init();
Geary.HTML.init();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]