UNPKG

recoder-code

Version:

๐Ÿš€ AI-powered development platform - Chat with 32+ models, build projects, automate workflows. Free models included!

39 lines (28 loc) โ€ข 705 B
var test = require('tape'); var Parser = require('../'); test('3 bytes of utf8', function (t) { t.plan(1); var p = new Parser(); p.onValue = function (value) { t.equal(value, 'โ”œโ”€โ”€'); }; p.write('"โ”œโ”€โ”€"'); }); test('utf8 snowman', function (t) { t.plan(1); var p = new Parser(); p.onValue = function (value) { t.equal(value, 'โ˜ƒ'); }; p.write('"โ˜ƒ"'); }); test('utf8 with regular ascii', function (t) { t.plan(4); var p = new Parser(); var expected = [ "snow: โ˜ƒ!", "xyz", "ยกque!" ]; expected.push(expected.slice()); p.onValue = function (value) { t.deepEqual(value, expected.shift()); }; p.write('["snow: โ˜ƒ!","xyz","ยกque!"]'); });