@@ -52,6 +52,8 @@ mybuffer = myTestFunction(bufstr);
52
52
mybuffer = myTestFunction ( bufstr ) ;
53
53
mybuffer . my_buffer = true ;
54
54
55
+ var OBJECT_KINDS = [ 'dict' , 'inobject' , 'numeric' , 'props' ] ;
56
+ var NODE_VERSION = common . getNodeVersion ( ) ;
55
57
56
58
/*
57
59
* Now we're going to fork ourselves to gcore
@@ -174,6 +176,24 @@ gcore.on('exit', function (code) {
174
176
assert . ok ( content . indexOf ( 'function myTestFunction()\n' ) != - 1 ) ;
175
177
assert . ok ( content . indexOf ( 'return (new Buffer(bufstr));\n' ) != - 1 ) ;
176
178
} ) ;
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
+ } ) ;
177
197
178
198
var mod = util . format ( '::load %s\n' ,
179
199
path . join ( __dirname ,
@@ -206,5 +226,9 @@ gcore.on('exit', function (code) {
206
226
mdb . stdin . write ( '::jsfunctions -n myTestFunction ! ' +
207
227
'awk \'NR == 2 {print $1}\' | head -1 > ' + tmpfile + '\n' ) ;
208
228
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
+ } ) ;
209
233
mdb . stdin . end ( ) ;
210
234
} ) ;
0 commit comments