Skip to content

Commit

Permalink
Added unicode tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchg committed Sep 3, 2011
1 parent 79dfa54 commit 42e27e8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
10 changes: 10 additions & 0 deletions support/test-runner/app.js
Expand Up @@ -296,4 +296,14 @@ suite('socket.test.js', function () {
}); });
}); });


server('test sending unicode', function (io) {
io.sockets.on('connection', function (socket) {
socket.on('message', function (msg) {
if (msg.test == "\u2028") {
socket.emit('done');
}
});
});
});

}); });
15 changes: 15 additions & 0 deletions test/socket.test.js
Expand Up @@ -336,6 +336,21 @@


socket.send('\n'); socket.send('\n');


socket.on('done', function () {
socket.disconnect();
next();
});
},

'test sending unicode': function (next) {
var socket = create();

socket.on('error', function (msg) {
throw new Error(msg || 'Received an error');
});

socket.json.send({ test: "\u2028" });

socket.on('done', function () { socket.on('done', function () {
socket.disconnect(); socket.disconnect();
next(); next();
Expand Down

0 comments on commit 42e27e8

Please sign in to comment.