[gjs/ewlsh/fix-fundamental-assert: 27/27] tests: Add a hacky test for Gdk.Event in GTK 4




commit 0bec59439d2a4a918f6be7ebb56216d11bdcc30c
Author: Philip Chimento <philip chimento gmail com>
Date:   Mon Mar 1 22:14:33 2021 -0800

    tests: Add a hacky test for Gdk.Event in GTK 4
    
    This test does practically nothing, but it ensures a minimal level of
    support for the new GFundamental types without crashing.

 installed-tests/js/testGtk4.js | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/installed-tests/js/testGtk4.js b/installed-tests/js/testGtk4.js
index af3fb75d..a8c3ead6 100644
--- a/installed-tests/js/testGtk4.js
+++ b/installed-tests/js/testGtk4.js
@@ -1,10 +1,11 @@
 // SPDX-License-Identifier: MIT OR LGPL-2.0-or-later
 // SPDX-FileCopyrightText: 2013 Giovanni Campagna <gcampagna src gnome org>
 
+imports.gi.versions.Gdk = '4.0';
 imports.gi.versions.Gtk = '4.0';
 
 const ByteArray = imports.byteArray;
-const {Gio, GObject, Gtk} = imports.gi;
+const {Gdk, Gio, GObject, Gtk} = imports.gi;
 
 // This is ugly here, but usually it would be in a resource
 function createTemplate(className) {
@@ -175,3 +176,9 @@ describe('Gtk overrides', function () {
         expect(iter.stamp).toEqual(42);
     });
 });
+
+describe('Gtk 4 regressions', function () {
+    it('Gdk.Event fundamental type should not crash', function () {
+        expect(() => new Gdk.Event()).toThrowError(/Couldn't find a constructor/);
+    });
+});


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