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
|
Rev | Line | |
---|
[6a3a178] | 1 | var test = require('tape');
|
---|
| 2 | var Parser = require('../');
|
---|
| 3 |
|
---|
| 4 | test('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 |
|
---|
| 15 | test('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.