File tree 2 files changed +14
-8
lines changed
2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ describe('Object', function () {
21
21
assert . deepEqual ( obj , out )
22
22
} )
23
23
24
- it ( 'should retain references to written Objects' , function ( ) {
24
+ it ( 'should retain references to written Objects' , function ( done ) {
25
25
var o_gc = false
26
26
var buf_gc = false
27
27
var o = { foo : 'bar' }
@@ -41,9 +41,12 @@ describe('Object', function () {
41
41
42
42
// now GC `buf`
43
43
buf = null
44
- gc ( )
45
- assert ( buf_gc , '"buf" has not been garbage collected' )
46
- assert ( o_gc , '"o" has not been garbage collected' )
44
+ setImmediate ( function ( ) {
45
+ gc ( )
46
+ assert ( buf_gc , '"buf" has not been garbage collected' )
47
+ assert ( o_gc , '"o" has not been garbage collected' )
48
+ done ( )
49
+ } ) ;
47
50
} )
48
51
49
52
it ( 'should throw an Error when reading an Object from the NULL pointer' , function ( ) {
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ describe('pointer', function () {
20
20
assert . strictEqual ( ref . address ( out ) , ref . address ( test ) )
21
21
} )
22
22
23
- it ( 'should retain references to a written pointer in a Buffer' , function ( ) {
23
+ it ( 'should retain references to a written pointer in a Buffer' , function ( done ) {
24
24
var child_gc = false
25
25
var parent_gc = false
26
26
var child = new Buffer ( 'a pointer holding some data...' )
@@ -40,9 +40,12 @@ describe('pointer', function () {
40
40
41
41
// now GC `parent`
42
42
parent = null
43
- gc ( )
44
- assert ( parent_gc , '"parent" has not been garbage collected' )
45
- assert ( child_gc , '"child" has not been garbage collected' )
43
+ setImmediate ( function ( ) {
44
+ gc ( )
45
+ assert ( parent_gc , '"parent" has not been garbage collected' )
46
+ assert ( child_gc , '"child" has not been garbage collected' )
47
+ done ( )
48
+ } ) ;
46
49
} )
47
50
48
51
it ( 'should throw an Error when reading from the NULL pointer' , function ( ) {
You can’t perform that action at this time.
0 commit comments