source: trip-planner-front/node_modules/jsonparse/test/surrogate.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 451 bytes
RevLine 
[6a3a178]1var test = require('tape');
2var Parser = require('../');
3
4test('parse surrogate pair', 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('"\\uD83D\\uDE0B"');
13});
14
15test('parse chunked surrogate pair', 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('"\\uD83D');
24 p.write('\\uDE0B"');
25});
26
Note: See TracBrowser for help on using the repository browser.