| 1 | return { |
| 2 | { "stores and retrieves private XML", function (t) |
| 3 | local verse = require "harness".verse; |
| 4 | t.client("alice", function (c) |
| 5 | local data = verse.stanza("prefs", { xmlns = "urn:example:prefs" }):tag("colour"):text("blue"); |
| 6 | c:private_set("prefs", "urn:example:prefs", data, t.cb(function (reply) |
| 7 | assert(reply.attr.type == "result", "private_set failed"); |
| 8 | c:private_get("prefs", "urn:example:prefs", t.cb(function (result) |
| 9 | assert(result, "private_get returned nothing"); |
| 10 | assert(result:get_child_text("colour") == "blue", "stored data mismatch"); |
| 11 | t.done(); |
| 12 | end)); |
| 13 | end)); |
| 14 | end, { plugins = { "private" } }); |
| 15 | end }; |
| 16 | }; |