From b814f642d0a979bd5b30a6b1cfc366c7c492b0a1 Mon Sep 17 00:00:00 2001 From: David King Date: Tue, 15 Feb 2022 23:17:43 +0000 Subject: [PATCH] Relax cairo extents test --- gjs-1.71.1-cairo-textextents-test.patch | 33 +++++++++++++++++++++++++ gjs.spec | 2 ++ 2 files changed, 35 insertions(+) create mode 100644 gjs-1.71.1-cairo-textextents-test.patch diff --git a/gjs-1.71.1-cairo-textextents-test.patch b/gjs-1.71.1-cairo-textextents-test.patch new file mode 100644 index 0000000..313c051 --- /dev/null +++ b/gjs-1.71.1-cairo-textextents-test.patch @@ -0,0 +1,33 @@ +From 33a0fef9cc9103f873aa45dbdcb4fe99c2fffecb Mon Sep 17 00:00:00 2001 +From: Philip Chimento +Date: Tue, 15 Feb 2022 17:30:42 -0800 +Subject: [PATCH] test: Relax assertion in cr.textExtents() + +These three values seem to be DPI-dependent, so let's just make sure they +are numbers instead of any particular number. + +Closes: #461 +--- + installed-tests/js/testCairo.js | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/installed-tests/js/testCairo.js b/installed-tests/js/testCairo.js +index 186d0519d..c0c6d119f 100644 +--- a/installed-tests/js/testCairo.js ++++ b/installed-tests/js/testCairo.js +@@ -117,9 +117,9 @@ describe('Cairo', function () { + expect(cr.textExtents('trailing spaces ')).toEqual({ + xBearing: 0, + yBearing: -8, +- width: 72, +- height: 10, +- xAdvance: 81, ++ width: jasmine.any(Number), ++ height: jasmine.any(Number), ++ xAdvance: jasmine.any(Number), + yAdvance: 0, + }); + }); +-- +GitLab + diff --git a/gjs.spec b/gjs.spec index 8a360d2..627de0f 100644 --- a/gjs.spec +++ b/gjs.spec @@ -14,6 +14,8 @@ Summary: Javascript Bindings for GNOME License: MIT and (MPLv1.1 or GPLv2+ or LGPLv2+) URL: https://wiki.gnome.org/Projects/Gjs Source0: https://download.gnome.org/sources/%{name}/1.71/%{name}-%{version}.tar.xz +# https://gitlab.gnome.org/GNOME/gjs/-/issues/461 +Patch0: gjs-1.71.1-cairo-textextents-test.patch BuildRequires: gcc-c++ BuildRequires: meson