Added unicode tests.

This commit is contained in:
Guillermo Rauch
2011-09-03 13:26:22 -07:00
parent 79dfa54105
commit 42e27e857c
2 changed files with 25 additions and 0 deletions

View File

@@ -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');
}
});
});
});
});

View File

@@ -336,6 +336,21 @@
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.disconnect();
next();