Software /
code /
prosody
File
spec/util_poll_spec.lua @ 13062:da51c36ed1e7
mod_admin_shell: Add config:set([host,] key, value) because why not
We had config:get() but not this.
> <MattJ> Yeah, why did we never implement that?
Handy if you want to quickly try out settings without reloading the
whole config.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 08 Apr 2023 11:28:55 +0200 |
parent | 12400:728d1c1dc7db |
line wrap: on
line source
describe("util.poll", function() local poll; setup(function() poll = require "util.poll"; end); it("loads", function() assert.is_table(poll); assert.is_function(poll.new); assert.is_string(poll.api); end); describe("new", function() local p; setup(function() p = poll.new(); end) it("times out", function () local fd, err = p:wait(0); assert.falsy(fd); assert.equal("timeout", err); end); it("works", function() -- stdout should be writable, right? assert.truthy(p:add(1, false, true)); local fd, r, w = p:wait(1); assert.is_number(fd); assert.is_boolean(r); assert.is_boolean(w); assert.equal(1, fd); assert.falsy(r); assert.truthy(w); assert.truthy(p:del(1)); end); end) end);