Permalink
Browse files

some updates to tests, experimental memory stuff

  • Loading branch information...
1 parent 46b8ea0 commit cadcdb59e940acd7ad658ad7b24caffbb49f1348 @Benvie committed Sep 23, 2012
Showing with 13 additions and 9 deletions.
  1. +1 −1 test/memory-reading.js
  2. +12 −8 test/weakmap-test.js
View
2 test/memory-reading.js
@@ -9,7 +9,7 @@ module.exports = function memoryReading(name){
delete readings[name];
return result;
} else {
- readings[name] = new MemoryReading(name);
+ return readings[name] = new MemoryReading(name);
}
}
View
20 test/weakmap-test.js
@@ -45,11 +45,15 @@ test('errors', function(t){
});
-// test('garbage collection', function(t){
-// memoryReading();
-// for (var i=0; i < 100; i++) {
-// new WM;
-// }
-// console.log(memoryReading());
-// t.end();
-// });
+test('garbage collection', function(t){
+ var create = memoryReading('create');
+ for (var i=0; i < 1000; i++) {
+ var x = new WM;
+ x.set({}, {});
+ }
+ console.log(memoryReading('create'));
+ setTimeout(function(){
+ console.log(create.compare(memoryReading('create')));
+ }, 100);
+ t.end();
+});

0 comments on commit cadcdb5

Please sign in to comment.