[gjs: 1/3] testGObjectClass: Ensure objects have a toString definition



commit e3b6edc4897ebbadce3e13594cdbcdc78889edb8
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Tue May 28 23:16:57 2019 -0500

    testGObjectClass: Ensure objects have a toString definition

 installed-tests/js/testGObjectClass.js | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/installed-tests/js/testGObjectClass.js b/installed-tests/js/testGObjectClass.js
index 1bd75285..925dbd76 100644
--- a/installed-tests/js/testGObjectClass.js
+++ b/installed-tests/js/testGObjectClass.js
@@ -377,4 +377,11 @@ describe('GObject class with decorator', function () {
         expect(mon.networkAvailable).toBeDefined();
         expect(mon['network-available']).toBeDefined();
     });
+
+    it('has a toString() defintion', function() {
+        expect(myInstance.toString()).toMatch(
+            /\[object instance wrapper GType:Gjs_MyObject jsobj@0x[a-f0-9]+ native@0x[a-f0-9]+\]/);
+        expect(new Derived().toString()).toMatch(
+            /\[object instance wrapper GType:Gjs_Derived jsobj@0x[a-f0-9]+ native@0x[a-f0-9]+\]/);
+    });
 });


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