diff options
author | Kim Alvefur <zash@zash.se> | 2022-12-20 18:55:47 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2022-12-20 18:55:47 +0100 |
commit | 965c49b92d07fa658e0b7ee7b37b89c900331202 (patch) | |
tree | a8e815f72633f330ba3d36d727b4e6a150956f4a /spec | |
parent | d89ff6e3cbc3cee9bb001a0b878281e1f3d7c6e1 (diff) | |
download | prosody-965c49b92d07fa658e0b7ee7b37b89c900331202.tar.gz prosody-965c49b92d07fa658e0b7ee7b37b89c900331202.zip |
util.datamapper: Simplify test schema
Don't need the function, more compact to just reference the same
reference table.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/util_datamapper_spec.lua | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/spec/util_datamapper_spec.lua b/spec/util_datamapper_spec.lua index 51ccf127..cc0e80e1 100644 --- a/spec/util_datamapper_spec.lua +++ b/spec/util_datamapper_spec.lua @@ -15,22 +15,22 @@ describe("util.datamapper", function() setup(function() -- a convenience function for simple attributes, there's a few of them - local function attr() return {["$ref"]="#/$defs/attr"} end + local attr = {["$ref"]="#/$defs/attr"}; s = { ["$defs"] = { attr = { type = "string"; xml = { attribute = true } } }; type = "object"; xml = {name = "message"; namespace = "jabber:client"}; properties = { - to = attr(); - from = attr(); - type = attr(); - id = attr(); + to = attr; + from = attr; + type = attr; + id = attr; body = true; -- should be assumed to be a string lang = {type = "string"; xml = {attribute = true; prefix = "xml"}}; delay = { type = "object"; xml = {namespace = "urn:xmpp:delay"; name = "delay"}; - properties = {stamp = attr(); from = attr(); reason = {type = "string"; xml = {text = true}}}; + properties = {stamp = attr; from = attr; reason = {type = "string"; xml = {text = true}}}; }; state = { type = "string"; @@ -66,8 +66,8 @@ describe("util.datamapper", function() xml = {name = "stanza-id"; namespace = "urn:xmpp:sid:0"}; type = "object"; properties = { - id = attr(); - by = attr(); + id = attr; + by = attr; }; }; }; @@ -120,10 +120,10 @@ describe("util.datamapper", function() namespace = "jabber:client" }; properties = { - to = attr(); - from = attr(); - type = attr(); - id = attr(); + to = attr; + from = attr; + type = attr; + id = attr; disco = { type = "object"; xml = { |