Accepting request 1031983 from GNOME:Next

- Add gnome-maps-icu72.patch: fix comparisons in time tests
  (glgo#GNOME/gnome-maps!261).

OBS-URL: https://build.opensuse.org/request/show/1031983
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gnome-maps?expand=0&rev=167
This commit is contained in:
Dominique Leuenberger 2022-10-31 08:21:57 +00:00 committed by Git OBS Bridge
parent 84d5045cdc
commit 151d9a877a
3 changed files with 66 additions and 0 deletions

58
gnome-maps-icu72.patch Normal file
View File

@ -0,0 +1,58 @@
From bec3d2f26de1b3a8c8b7e603f6d6a46c853426fa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= <ablocorrea@hotmail.com>
Date: Fri, 28 Oct 2022 01:05:28 +0200
Subject: [PATCH 1/2] tests/timeTest: Fix tests for time formats with different
kind of spaces
Time.format does not warranty the character used for spaces, neither
that it will not introduce preceding byte order marks. Solve it by
comparing inclusion of the data and that it finishes with AM or PM.
Closes #506
---
tests/timeTest.js | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/tests/timeTest.js b/tests/timeTest.js
index 96803f2f..d025e8e8 100644
--- a/tests/timeTest.js
+++ b/tests/timeTest.js
@@ -23,6 +23,11 @@ const JsUnit = imports.jsUnit;
import * as Time from './time.js';
+function compare12HourTime(format, hoursMinutes, AMPM) {
+ JsUnit.assertTrue(format.includes(hoursMinutes));
+ JsUnit.assertTrue(format.endsWith(AMPM));
+}
+
function formatTimeWithTZOffsetTest() {
// mock to always use 24 hour format
Time._setIs12HourFunction(() => { return false; });
@@ -35,8 +40,8 @@ function formatTimeWithTZOffsetTest() {
// mock to always use 12 hour format
Time._setIs12HourFunction(() => { return true; });
- JsUnit.assertEquals('10:54 PM',
- Time.formatTimeWithTZOffset(1607982864000, 3600000));
+ compare12HourTime(Time.formatTimeWithTZOffset(1607982864000, 3600000),
+ '10:54', 'PM');
}
function formatTimeFromHoursAndMinsTest() {
@@ -50,9 +55,9 @@ function formatTimeFromHoursAndMinsTest() {
// mock to always use 12 hour format
Time._setIs12HourFunction(() => { return true; });
- JsUnit.assertEquals('12:34 PM', Time.formatTimeFromHoursAndMins(12, 34));
- JsUnit.assertEquals('12:00 AM', Time.formatTimeFromHoursAndMins(24, 0));
- JsUnit.assertEquals('12:01 PM', Time.formatTimeFromHoursAndMins(12, 1));
+ compare12HourTime(Time.formatTimeFromHoursAndMins(12, 34), '12:34', 'PM');
+ compare12HourTime(Time.formatTimeFromHoursAndMins(24, 0), '12:00', 'AM');
+ compare12HourTime(Time.formatTimeFromHoursAndMins(12, 1), '12:01', 'PM');
}
formatTimeWithTZOffsetTest();
--
2.38.0

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Oct 28 14:55:12 UTC 2022 - Michael Gorse <mgorse@suse.com>
- Add gnome-maps-icu72.patch: fix comparisons in time tests
(glgo#GNOME/gnome-maps!261).
-------------------------------------------------------------------
Sat Oct 22 11:32:16 UTC 2022 - Bjørn Lie <bjorn.lie@gmail.com>

View File

@ -26,6 +26,8 @@ URL: https://wiki.gnome.org/Apps/Maps
Source0: https://download.gnome.org/sources/gnome-maps/43/%{name}-%{version}.tar.xz
# PATCH-FIX-UPSTREAM gnome-maps-fix-dependency.patch -- Fix upstream dodo when setting dependency for libshumate
Patch0: gnome-maps-fix-dependency.patch
# PATCH-FIX-UPSTREAM gnome-maps-icu72.patch mgorse@suse.com -- fix comparisons in time tests.
Patch1: gnome-maps-icu72.patch
BuildRequires: appstream-glib
BuildRequires: desktop-file-utils