aboutsummaryrefslogtreecommitdiffstats
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
* util.error: Use is_error() instead of is_err() everywhereKim Alvefur2024-10-291-7/+7
| | | | Continuation of 4b39691a274e
* util.xtemplate: Fix error on applying each() to zero stanzasKim Alvefur2024-07-111-0/+4
|
* Merge 0.12->trunkKim Alvefur2024-06-121-0/+2
|\
| * scansion: Enable blocklist compat during tests to fix CIKim Alvefur2024-06-121-0/+2
| |
* | scansion: Add roster groups setting to pubsub form in testsKim Alvefur2024-06-124-0/+6
| |
* | util.bit53: Add bnot() methodMatthew Wild2024-03-011-0/+4
| |
* | util.strbitop: Remove unused import in testsMatthew Wild2024-02-231-1/+1
| |
* | util.strbitop: Add common_prefix_bits() methodMatthew Wild2024-02-231-0/+44
| | | | | | | | | | This returns the number of bits that two strings have in common. It is significantly more efficient than similar calculations in Lua.
* | util.ip: Add another test case for match() and commonPrefixLength()Matthew Wild2024-02-231-0/+4
| |
* | util.strbitop: Rename spec file to correct name so tests actually runMatthew Wild2024-02-231-0/+0
| |
* | util.rfc6724: Remove, unused since introduction of Happy EyeballsKim Alvefur2024-02-221-97/+0
| | | | | | | | | | | | | | | | It was mainly used to determine whether to try IPv6 or IPv4 first, following the rules for this in the RFC. Now we always try IPv6 and IPv4 at roughly the same time, thus there no need to carry these rules.
* | MUC: Record reason for affiliation changes and return in list (fixes #1227)Kim Alvefur2021-08-081-0/+72
| |
* | MUC: Test that <subject/> + <thread/> is not handled as subject changeKim Alvefur2024-01-231-0/+29
| | | | | | | | | | Ref #667 Ref #1838
* | Merge 0.12->trunkKim Alvefur2023-12-171-0/+26
|\|
| * mod_disco: Advertise disco#info and #items on bare JIDs to fix #1664Kim Alvefur2023-12-171-0/+26
| | | | | | | | | | | | | | | | Having to add these in *there* places seems less than ideal. I would also think that advertising disco#info is a bit redundant, since it is a requirement for everything in XMPP and if it was missing you would get an error back.
* | scansion: Use new style for accessing Lua globalsKim Alvefur2023-12-171-1/+1
| |
* | scansion: Use new prosody namespace in importKim Alvefur2023-12-171-1/+1
| |
* | scansion: Use captures or wildcards instead of mocking timeKim Alvefur2023-12-175-24/+14
| | | | | | | | | | > Mockery is one of the things I hold dear! And he's making a mockery of it!! -- Belkar Bitterleaf
* | util.xtemplate: Test the each template functionKim Alvefur2023-12-161-0/+8
| | | | | | | | | | | | | | | | It iterates over childtags, so a template like {foo|each{...}} would be equivalent to root:childtags("foo"), while a deeper query needs the bit that becomes arguments to :childtags as an argument to each, e.g. {foo/bar|each(baz)} would behave like root:get_child("foo"):get_child("bar"):childtags("baz")
* | mod_storage_internal, tests: Fix before/after combined with the 'reverse' flagMatthew Wild2023-12-121-0/+24
| |
* | util.http: Silence strict luacheck warning in testsKim Alvefur2023-12-091-0/+1
| |
* | core.moduleapi: Silence strict luacheck warnings in testsKim Alvefur2023-12-091-3/+3
| |
* | util.throttle: Silence some strict luacheck warningsKim Alvefur2023-12-091-0/+1
| |
* | util.xtemplate: Add some initial testsKim Alvefur2023-12-091-0/+35
| | | | | | | | Strict typing does not magically make code correct
* | util.jsonschema: Return basic structured validation responseKim Alvefur2023-12-021-0/+1
| |
* | Merge 0.12->trunkKim Alvefur2023-12-011-0/+27
|\|
| * net.http.parser: Reject overlarge header section earlierKim Alvefur2023-08-231-0/+27
| | | | | | | | This case would eventually be rejected by the buffer size limit.
| * util.array: Fix new() library functionKim Alvefur2023-07-221-0/+7
| | | | | | | | Backport of ffe4adbd2af9 since new was added in the 0.12 branch
* | util.human.io: Don't accept ambiguous durations by defaultMatthew Wild2023-11-301-1/+32
| | | | | | | | | | The new method parse_duration_lax() exports the old behaviour, mainly for compatibility purposes.
* | util.uuid: Add UUIDv7Kim Alvefur2021-08-151-0/+22
| | | | | | | | | | | | | | | | | | Allows sorting by id as a substitute for sorting by timestamp since it has the timestamp in the encoded in the first part, and only things that happen extremely close together may get out of order by such a sort, which might not matter. From draft-ietf-uuidrev-rfc4122bis formerly draft-peabody-dispatch-new-uuid-format
* | util.array: Fix new() library functionKim Alvefur2023-07-221-0/+7
| |
* | tests: Add hack to test only a single storage driverKim Alvefur2023-07-221-0/+5
| | | | | | | | | | Fixes that LuaDBI being unavailable makes these produce nothing but endless stack overflows in luarocks.
* | tests: Update storagemanager tests for prosody.* namespace changeKim Alvefur2023-07-221-8/+6
| | | | | | | | | | Part of an attempt to make these tests work again. Previously they would just explode in a million luarocks stack overflows
* | util.human.io: Add tests for parse_duration() (some failing)Kim Alvefur2023-07-161-0/+9
| |
* | util.human.io: Include relevant arguments in test messagesKim Alvefur2023-07-161-1/+1
| | | | | | | | This way the relevant arguments are shown in case a test case fails
* | util.human.io: Use tail call in test to get correct line numbersKim Alvefur2023-07-161-1/+1
| | | | | | | | | | | | This is probably not guaranteed to work and might vary with Lua version, but it's good enough for me to get accurate line numbers out of Busted that don't all point to the test() function.
* | util.cache: Pass cache itself to eviction callbackKim Alvefur2023-06-301-2/+1
| | | | | | | | | | | | | | Simplifies access to the cache without moving code around a lot given the currently common pattern of local some_cache = cache.new(size, function(k,v) end)
* | util.cache: Keep eviction candidate if callback resized to make roomKim Alvefur2023-06-301-0/+21
| | | | | | | | | | Previously either the old or the new values would be rejected, even if the cache was resized to allow more items.
* | util.argparse: Add support for repeatable parametersKim Alvefur2022-01-051-0/+5
| | | | | | | | These are gathered into arrays
* | storagemanager tests: Reorder test data in chronological orderKim Alvefur2021-05-111-13/+13
| | | | | | | | | | | | | | Why was the test data not in chronological order? Altho, maybe that was the point? Except for MAM, the data might *not* be in chronological order!
* | util.http: Implement parser for RFC 7239 Forwarded headerKim Alvefur2023-06-031-0/+21
| | | | | | | | | | | | | | | | Standardized and structured replacement for the X-Forwarded-For, X-Forwarded-Proto set of headers. Notably, this allows per-hop protocol information, unlike X-Forwarded-Proto which is always a single value for some reason.
* | util.sasl: Add basic tests for OAUTHBEARERKim Alvefur2023-05-261-0/+32
| |
* | util.jsonschema: Update test suite ignore rulesKim Alvefur2023-05-201-5/+6
| | | | | | | | A test case was added in the middle, so all these need to be reordered.
* | util.jsonschema: Fix UTF-8ness of 'minLength' and 'maxLength'Kim Alvefur2023-04-231-2/+0
| |
* | util.jsonschema: Implement 'minContains' and 'maxContains'Kim Alvefur2023-04-231-2/+0
| |
* | util.jsonschema: Tweak description of disabled testKim Alvefur2023-04-221-1/+1
| | | | | | | | | | | | This doesn't fail because of additionalProperties, looks more like some issue with recursive definitions and util.jsonpointer that I don't want feel like investigating now.
* | util.jsonschema: Enable passing IEEE 754 equality testKim Alvefur2023-04-221-1/+0
| |
* | util.error: Add test for #1805Kim Alvefur2023-04-191-0/+3
| | | | | | | | Checks that it doesn't fail on a stanza without <error> tag
* | util.human.io: Add parse_duration() method to parse a duration stringMatthew Wild2023-04-071-0/+18
| | | | | | | | | | Similar logic occurs throughout various modules in the codebase. We might even want a module:get_option_duration()??
* | integration tests: Preserve unmocked time.monotonic()Matthew Wild2023-04-061-6/+5
| | | | | | | | | | | | | | | | | | | | With monotonic() frozen, timers may fail to trigger. This caused problems after the new util.startup changes that moved the server-started event to a timer. The timer wouldn't trigger, the event didn't fire, and prosody would fail to daemonize. All the tests that depend on specific time behaviour are depending on wall clock time, so only mocking util.time.now() and os.time() fixes those.