Matthew Wild
a095a0c533
util.debug: Fix locals being reported under wrong stack frame in some cases (+tests!!)
5 years ago
Kim Alvefur
d5161fbf6f
util.strbitop: Add tests covering basics
...
Also as docs
5 years ago
Matthew Wild
64856637ce
net.websocket.frames: Add test for empty frame with MASK and key set
5 years ago
Kim Alvefur
00bad1a9fe
net.websocket.frames: Use C string XOR implementation
5 years ago
Kim Alvefur
c812a98068
util_paths_spec: Trim trailing white space
...
And add spacing between describe() blocks
5 years ago
Kim Alvefur
fce45aff34
util.paths: Add some tests
5 years ago
Kim Alvefur
d3b3e21720
util.dbuffer: Expose length as :len() method, like strings
...
Ref #1598
5 years ago
Waqas Hussain
80beeeb187
util.indexedbheap: Fix heap datastructure corruption in :reschedule(smaller_value)
5 years ago
Kim Alvefur
33070035bf
util.error: Drop registry initialization with namespace as key
...
Enough complexity with compact vs normal and with/without namespace
5 years ago
Kim Alvefur
9dbdb91c47
util.error: Expand compact registries into normal form internally
...
Also the exposed form on the table returned from init()
5 years ago
Kim Alvefur
5da983d8bd
util.error: Add a "compact mode" for registries
...
Inspired by the older registry in pubsub.lib.lua
5 years ago
Kim Alvefur
dc446463ab
util.error: Cover registry initialization in test
5 years ago
Kim Alvefur
a51d591246
util.error: Collect Application-Specific Conditions from stanza errors
5 years ago
Kim Alvefur
0354452a9a
util.error: Extract error originator from stanza errors
5 years ago
Kim Alvefur
815ce25d10
util.stanza: Extract Application-Specific Condition from errors
...
API change
5 years ago
Kim Alvefur
a7c3fc20a0
spec.stanza spec: Split up util.error related tests
5 years ago
Kim Alvefur
1c53f533b0
util.stanza: Support Application-Specific Conditions in util.error
5 years ago
Kim Alvefur
8c0efc9e55
util.stanza: Get 'by' from context instead
...
Zash> <error by=?> should go where? extra.by? context? source?
Zash> In Prosody this would usually be module.host or a bare user/room JID
MattJ> Zash: context
MattJ> context.by, basically the opposite of context.actor
5 years ago
Kim Alvefur
3f9988468d
util.stanza: Support inclusion of <gone> URI from util.error object
5 years ago
Kim Alvefur
2f0b85ce29
util.stanza: Support getting 'by' from util.error object
5 years ago
Kim Alvefur
ed5841e42b
util.error: Add well-known field 'extra'
...
A place for various extra fields and edge cases of the stanza error data
model, e.g. the URI field of <gone>
5 years ago
Kim Alvefur
095c4f8344
util.dbuffer: Simplify test case
...
An earlier theory involved the bug being related to collapsing multiple
items, so it exercised that too.
Also correct the comment, it referred to the space in "hello world" in
an earlier version before the test string was changed to "foobar", which
was what was tested in a REPL
5 years ago
Matthew Wild
145f8fbad7
MUC tests: Add missing affiliation attribute
6 years ago
Matthew Wild
fef49a627e
Backed out changeset 18f2c7bc5795 (was testing against wrong branch)
6 years ago
Matthew Wild
7d8f93d688
MUC tests: Add <required/> to expected form field
6 years ago
Kim Alvefur
bc20052a9b
util.dataforms: Add support for validating (integer) ranges
6 years ago
Matthew Wild
686adb2d71
util.interpolation: Add test for ~ when value is false (not just nil)
5 years ago
Matthew Wild
0ca2e88384
util.interpolation: Add '~' as the opposite of '&' (render sub-block if falsy)
...
One more magic character consumed!
5 years ago
Matthew Wild
e419f0b5f4
util.event: Add luacheck annotation to unused parameter in tests
5 years ago
Matthew Wild
c909bca762
util.events: Add set_debug_hook() method
...
Hook signature:
ret = debug_hook(handler, event_name, event_data)
5 years ago
Kim Alvefur
403f320d90
util.jid: Add test coverage for XEP-0106: JID Escaping functions
5 years ago
Kim Alvefur
21ecc6ca39
util.dbuffer: Simplify test case
...
An earlier theory involved the bug being related to collapsing multiple
items, so it exercised that too.
Also correct the comment, it referred to the space in "hello world" in
an earlier version before the test string was changed to "foobar", which
was what was tested in a REPL
5 years ago
Matthew Wild
7fa4cc8de0
util.dbuffer: Fix :sub() not working with partially-consumed chunks (thanks Zash for test case)
...
This also appears to fix some bugs with chunk-encoded streams in net.http.parser.
5 years ago
Kim Alvefur
e21429d8e4
util.dbuffer: Add failing test case involving :sub after :discard
5 years ago
Kim Alvefur
b289d05cfb
mod_external_services: XEP-0215: External Service Discovery
6 years ago
Matthew Wild
54e37ffe8d
net.http.parser: Allow configuration of the chunk size fed to the parser
5 years ago
Matthew Wild
76dd86054c
net.http.parser: Switch tests so that CRLF conversion of input data is optional
5 years ago
Matthew Wild
70b697de98
net.http.parser: Fix incorrect path in test
5 years ago
Matthew Wild
076d8b698f
net.http.parser: Add failing test for (large?) chunk-encoded responses
5 years ago
Matthew Wild
9115d2a366
util.dbuffer: Fix traceback when :collapse() is called on empty buffer
5 years ago
Kim Alvefur
8de93db692
util.dataforms: Add more XEP-0211 media element test coverage
5 years ago
Kim Alvefur
1c0e4300ab
util.dataforms: Convert media element sizes to avoid error on Lua 5.3
...
The stanza API does not accept number values and threw an error due to
the height and width attributes of the media element (XEP-0221).
This part had no test coverage previously, explaining why it was not
discovered until now.
5 years ago
Kim Alvefur
91d2ab9108
net.http.parser: Allow specifying sink for large request bodies
...
This enables uses such as saving uploaded files directly to a file on
disk or streaming parsing of payloads.
See #726
5 years ago
Kim Alvefur
1c0950bc36
mod_server_contact_info: Add status-addresses field
...
XEP-0157 version 1.1.0
6 years ago
Kim Alvefur
b15a51597b
scansion/prosody.cfg: Fix typo
6 years ago
Kim Alvefur
14cdec45c5
util.indexedbheap: Add failing test case for #1572
...
This approximates what happens if you add a timer far in the future,
then reschedule it to right now.
6 years ago
Matthew Wild
67cf276ba2
util.dbuffer: If no bytes parameter passed to read, return remainder of frontmost chunk
6 years ago
Kim Alvefur
c2ba37df93
util.human.io: Add brief test of table generation
6 years ago
Matthew Wild
8cc0b83179
util.dbuffer: Don't use # operator in tests, Lua 5.1 doesn't support __len
6 years ago
Matthew Wild
fb8e10737d
util.dbuffer: dynamic string buffer
...
Similar to util.ringbuffer (and shares almost identical API). Differences:
- size limit is optional and dynamic
- does not allocate a fixed buffer of max_size bytes
- focus on simply storing references to existing string objects where possible,
avoiding unnecessary allocations
- references are still stored in a ring buffer to enable use as a fast FIFO
Optional second parameter to new() provides the number of ring buffer segments. On
Lua 5.2 on my laptop, a segment is ~19 bytes. If the ring buffer fills up, the next
write will compact all strings into a single item.
6 years ago