mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
Added unicode tests.
This commit is contained in:
@@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user