Permalink
Browse files

more passing utf8 tests

  • Loading branch information...
1 parent fba4e12 commit 459f513d0278fccc4ead28314c243f5b54190fcd @substack substack committed Dec 19, 2012
Showing with 26 additions and 1 deletion.
  1. +26 −1 test/utf8.js
View
@@ -1,7 +1,7 @@
var test = require('tape');
var Parser = require('../');
-test('utf8', function (t) {
+test('3 bytes of utf8', function (t) {
t.plan(1);
var p = new Parser();
@@ -11,3 +11,28 @@ test('utf8', function (t) {
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!"]');
+});

0 comments on commit 459f513

Please sign in to comment.