summaryrefslogtreecommitdiff
path: root/installed-tests
diff options
context:
space:
mode:
authorNasah Kuma <nasahnash19@gmail.com>2022-04-29 21:15:08 +0100
committerNasah <nasahnash19@gmail.com>2022-06-13 05:38:34 +0100
commit115867d662672997d8e155b99d71056baea2d1be (patch)
treef476fd3c46cd7ce5cff0152ad4ab01e0fe86e58c /installed-tests
parentcce1ef420e1fe81695dd99c692b97e9dfc1e5a70 (diff)
downloadgjs-115867d662672997d8e155b99d71056baea2d1be.tar.gz
Add check for GObject introspected objects to pretty-print
Diffstat (limited to 'installed-tests')
-rw-r--r--installed-tests/js/testPrint.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/installed-tests/js/testPrint.js b/installed-tests/js/testPrint.js
index f6d27405..9b582c28 100644
--- a/installed-tests/js/testPrint.js
+++ b/installed-tests/js/testPrint.js
@@ -3,6 +3,8 @@
// SPDX-FileCopyrightText: 2022 Nasah Kuma <nasahnash19@gmail.com>
const GLib = imports.gi.GLib;
+imports.gi.versions.Gdk = '3.0';
+const Gdk = imports.gi.Gdk;
describe('print', function () {
it('can be spied upon', function () {
@@ -142,4 +144,16 @@ describe('prettyPrint', function () {
'JS LOG: { date: 2018-12-24T10:33:30.000Z }');
log({date: new Date(Date.UTC(2018, 11, 24, 10, 33, 30))});
});
+
+ it('toString is overridden on object', function () {
+ GLib.test_expect_message('Gjs', GLib.LogLevelFlags.LEVEL_MESSAGE,
+ 'JS LOG: [boxed instance wrapper GIName:*]');
+ log(new Gdk.Rectangle());
+ });
+
+ it('string tag supplied', function () {
+ GLib.test_expect_message('Gjs', GLib.LogLevelFlags.LEVEL_MESSAGE,
+ 'JS LOG: [object GIRepositoryNamespace]');
+ log(Gdk);
+ });
});