Skip to content

Instantly share code, notes, and snippets.

@JacksonTian
Last active August 29, 2015 14:22

Revisions

  1. JacksonTian revised this gist Jun 8, 2015. 1 changed file with 4 additions and 5 deletions.
    9 changes: 4 additions & 5 deletions test.js
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,11 @@
    var assert = require('assert');
    var exec = require('child_process').exec;

    var unicode = '中文测试'; // length: 12
    var child = exec('echo ' + unicode, {
    encoding: 'utf8',
    maxBuffer: 8
    }, function(err, stdout, stderr) {
    assert(err);
    assert.equal(err.message, 'stdout maxBuffer exceeded.');
    success_count++;
    });
    console.log(err);
    console.log(stdout);
    console.log(stderr);
    });
  2. JacksonTian created this gist Jun 8, 2015.
    12 changes: 12 additions & 0 deletions test.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    var assert = require('assert');
    var exec = require('child_process').exec;

    var unicode = '中文测试'; // length: 12
    var child = exec('echo ' + unicode, {
    encoding: 'utf8',
    maxBuffer: 8
    }, function(err, stdout, stderr) {
    assert(err);
    assert.equal(err.message, 'stdout maxBuffer exceeded.');
    success_count++;
    });