diff -r bc4c2d9765f1 -r 88a3e03f4b9f spec/stanzacmp_spec.lua --- a/spec/stanzacmp_spec.lua Thu Sep 06 18:11:16 2018 +0100 +++ b/spec/stanzacmp_spec.lua Thu Sep 06 18:23:56 2018 +0100 @@ -1,8 +1,24 @@ local stanzacmp = require "scansion.stanzacmp"; local verse = require "verse"; local st = require "util.stanza"; +local xml = require "scansion.xml"; + +local function parse(...) + local n = select("#", ...); + local out = {}; + for i = 1, n do + local v = (select(i, ...)); + if type(v) == "string" then + out[i] = xml.parse(v); + else + out[i] = v; + end + end + return table.unpack(out, 1, n); +end local function yes(s1, s2) + s1, s2 = parse(s1, s2); if not stanzacmp.stanzas_match(s1, s2) then print("s1", s1) print("s2", s2) @@ -12,6 +28,7 @@ end local function no(s1, s2) + s1, s2 = parse(s1, s2); if stanzacmp.stanzas_match(s1, s2) then print("s1", s1) print("s2", s2)