Comparison

spec/util_stanza_spec.lua @ 11205:9d1e21c23784 0.11

util.stanza: Reject ASCII control characters (fixes #1606)
author Kim Alvefur <zash@zash.se>
date Wed, 11 Nov 2020 16:00:41 +0100
parent 9673:e7e75b091c96
child 11206:f051394762ff
comparison
equal deleted inserted replaced
11201:4ae1d485a9c6 11205:9d1e21c23784
198 } 198 }
199 local invalid_data = { 199 local invalid_data = {
200 ["number"] = 1234, ["table"] = {}; 200 ["number"] = 1234, ["table"] = {};
201 ["utf8"] = string.char(0xF4, 0x90, 0x80, 0x80); 201 ["utf8"] = string.char(0xF4, 0x90, 0x80, 0x80);
202 ["nil"] = "nil"; ["boolean"] = true; 202 ["nil"] = "nil"; ["boolean"] = true;
203 ["control characters"] = "\0\1\2\3";
203 }; 204 };
204 205
205 for value_type, value in pairs(invalid_names) do 206 for value_type, value in pairs(invalid_names) do
206 it(value_type.." in tag names", function () 207 it(value_type.." in tag names", function ()
207 assert.error_matches(function () 208 assert.error_matches(function ()