aboutsummaryrefslogtreecommitdiff
path: root/sandbox/testAppNevena/Front/node_modules/jsonparse/test/big-token.js
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/testAppNevena/Front/node_modules/jsonparse/test/big-token.js')
-rw-r--r--sandbox/testAppNevena/Front/node_modules/jsonparse/test/big-token.js24
1 files changed, 0 insertions, 24 deletions
diff --git a/sandbox/testAppNevena/Front/node_modules/jsonparse/test/big-token.js b/sandbox/testAppNevena/Front/node_modules/jsonparse/test/big-token.js
deleted file mode 100644
index 36046317..00000000
--- a/sandbox/testAppNevena/Front/node_modules/jsonparse/test/big-token.js
+++ /dev/null
@@ -1,24 +0,0 @@
-var stream = require('stream');
-var JsonParse = require('../jsonparse');
-var test = require('tape');
-
-test('can handle large tokens without running out of memory', function (t) {
- var parser = new JsonParse();
- var chunkSize = 1024;
- var chunks = 1024 * 200; // 200mb
- var quote = Buffer.from ? Buffer.from('"') : new Buffer('"');
- t.plan(1);
-
- parser.onToken = function (type, value) {
- t.equal(value.length, chunkSize * chunks, 'token should be size of input json');
- t.end();
- };
-
- parser.write(quote);
- for (var i = 0; i < chunks; ++i) {
- var buf = Buffer.alloc ? Buffer.alloc(chunkSize) : new Buffer(chunkSize);
- buf.fill('a');
- parser.write(buf);
- }
- parser.write(quote);
-});