1var test = require('tape'); 2var Parser = require('../'); 3 4test('3 bytes of utf8', function (t) { 5 t.plan(1); 6 7 var p = new Parser(); 8 p.onValue = function (value) { 9 t.equal(value, '├──'); 10 }; 11 12 p.write('"├──"'); 13}); 14 15test('utf8 snowman', function (t) { 16 t.plan(1); 17 18 var p = new Parser(); 19 p.onValue = function (value) { 20 t.equal(value, '☃'); 21 }; 22 23 p.write('"☃"'); 24}); 25 26test('utf8 with regular ascii', function (t) { 27 t.plan(4); 28 29 var p = new Parser(); 30 var expected = [ "snow: ☃!", "xyz", "¡que!" ]; 31 expected.push(expected.slice()); 32 33 p.onValue = function (value) { 34 t.deepEqual(value, expected.shift()); 35 }; 36 37 p.write('["snow: ☃!","xyz","¡que!"]'); 38}); 39