@@ -52,6 +52,8 @@ mybuffer = myTestFunction(bufstr);
5252mybuffer = myTestFunction ( bufstr ) ;
5353mybuffer . my_buffer = true ;
5454
55+ var OBJECT_KINDS = [ 'dict' , 'inobject' , 'numeric' , 'props' ] ;
56+ var NODE_VERSION = common . getNodeVersion ( ) ;
5557
5658/*
5759 * Now we're going to fork ourselves to gcore
@@ -174,6 +176,24 @@ gcore.on('exit', function (code) {
174176 assert . ok ( content . indexOf ( 'function myTestFunction()\n' ) != - 1 ) ;
175177 assert . ok ( content . indexOf ( 'return (new Buffer(bufstr));\n' ) != - 1 ) ;
176178 } ) ;
179+ OBJECT_KINDS . forEach ( function ( kind ) {
180+ verifiers . push ( function verifyFindObjectsKind ( testLines ) {
181+ // There should be at least one object for
182+ // every kind of objects (except for the special cases
183+ // below)
184+ var expectedMinimumObjs = 1 ;
185+
186+ if ( kind === 'props' &&
187+ ( NODE_VERSION . major > 0 || NODE_VERSION . minor > 10 ) ) {
188+ // On versions > 0.10.x, currently there's no object
189+ // with the kind 'props'. There should be, but it's a minor
190+ // issue we're or to live with for now.
191+ expectedMinimumObjs = 0 ;
192+ }
193+
194+ assert . ok ( testLines . length >= expectedMinimumObjs ) ;
195+ } ) ;
196+ } ) ;
177197
178198 var mod = util . format ( '::load %s\n' ,
179199 path . join ( __dirname ,
@@ -206,5 +226,9 @@ gcore.on('exit', function (code) {
206226 mdb . stdin . write ( '::jsfunctions -n myTestFunction ! ' +
207227 'awk \'NR == 2 {print $1}\' | head -1 > ' + tmpfile + '\n' ) ;
208228 mdb . stdin . write ( '::cat ' + tmpfile + ' | ::jssource -n 0\n' ) ;
229+ OBJECT_KINDS . forEach ( function ( kind ) {
230+ mdb . stdin . write ( util . format ( '!echo test: findjsobjects -k %s\n' , kind ) ) ;
231+ mdb . stdin . write ( util . format ( '::findjsobjects -k %s\n' , kind ) ) ;
232+ } ) ;
209233 mdb . stdin . end ( ) ;
210234} ) ;
0 commit comments