Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.41
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
html_old /
pigeon /
node_modules /
ws /
test /
Delete
Unzip
Name
Size
Permission
Date
Action
fixtures
[ DIR ]
drwxr-xr-x
2022-06-27 18:41
BufferPool.test.js
1.89
KB
-rw-r--r--
2012-02-29 08:49
Receiver.hixie.test.js
3.04
KB
-rw-r--r--
2012-06-18 22:08
Receiver.test.js
8.64
KB
-rw-r--r--
2012-06-18 21:30
Sender.hixie.test.js
3.43
KB
-rw-r--r--
2012-05-19 12:12
Sender.test.js
739
B
-rw-r--r--
2012-02-29 14:54
Validation.test.js
1.83
KB
-rw-r--r--
2012-02-29 08:49
WebSocket.integration.js
1.04
KB
-rw-r--r--
2012-02-29 08:49
WebSocket.test.js
42.55
KB
-rw-r--r--
2012-06-26 18:27
WebSocketServer.test.js
31.26
KB
-rw-r--r--
2012-06-18 21:44
autobahn-server.js
732
B
-rw-r--r--
2012-02-29 08:49
autobahn.js
1.38
KB
-rw-r--r--
2012-05-20 12:21
hybi-common.js
2.2
KB
-rw-r--r--
2012-02-29 08:49
testserver.js
4.24
KB
-rw-r--r--
2012-06-18 21:33
Save
Rename
var BufferPool = require('../lib/BufferPool'); require('should'); describe('BufferPool', function() { describe('#ctor', function() { it('allocates pool', function() { var db = new BufferPool(1000); db.size.should.eql(1000); }); }); describe('#get', function() { it('grows the pool if necessary', function() { var db = new BufferPool(1000); var buf = db.get(2000); db.size.should.be.above(1000); db.used.should.eql(2000); buf.length.should.eql(2000); }); it('grows the pool after the first call, if necessary', function() { var db = new BufferPool(1000); var buf = db.get(1000); db.used.should.eql(1000); db.size.should.eql(1000); buf.length.should.eql(1000); var buf2 = db.get(1000); db.used.should.eql(2000); db.size.should.be.above(1000); buf2.length.should.eql(1000); }); it('grows the pool according to the growStrategy if necessary', function() { var db = new BufferPool(1000, function(db, length) { return db.size + 2345; }); var buf = db.get(2000); db.size.should.eql(3345); buf.length.should.eql(2000); }); it('doesnt grow the pool if theres enough room available', function() { var db = new BufferPool(1000); var buf = db.get(1000); db.size.should.eql(1000); buf.length.should.eql(1000); }); }); describe('#reset', function() { it('shinks the pool', function() { var db = new BufferPool(1000); var buf = db.get(2000); db.reset(true); db.size.should.eql(1000); }); it('shrinks the pool according to the shrinkStrategy', function() { var db = new BufferPool(1000, function(db, length) { return db.used + length; }, function(db) { return 0; }); var buf = db.get(2000); db.reset(true); db.size.should.eql(0); }); }); });