Comparison

tests/test_util_stanza.lua @ 5776:bd0ff8ae98a8

Remove all trailing whitespace
author Florian Zeitz <florob@babelmonkeys.de>
date Fri, 09 Aug 2013 17:48:21 +0200
parent 3639:889ef938552c
child 7254:8aaae816cc7e
comparison
equal deleted inserted replaced
5775:a6c2b8933507 5776:bd0ff8ae98a8
1 -- Prosody IM 1 -- Prosody IM
2 -- Copyright (C) 2008-2010 Matthew Wild 2 -- Copyright (C) 2008-2010 Matthew Wild
3 -- Copyright (C) 2008-2010 Waqas Hussain 3 -- Copyright (C) 2008-2010 Waqas Hussain
4 -- 4 --
5 -- This project is MIT/X11 licensed. Please see the 5 -- This project is MIT/X11 licensed. Please see the
6 -- COPYING file in the source package for more information. 6 -- COPYING file in the source package for more information.
7 -- 7 --
8 8
9 9
16 assert_is_not(getmetatable(stanza2), "Preserialized stanza has no metatable"); 16 assert_is_not(getmetatable(stanza2), "Preserialized stanza has no metatable");
17 end 17 end
18 18
19 function deserialize(deserialize, st) 19 function deserialize(deserialize, st)
20 local stanza = st.stanza("message", { a = "a" }); 20 local stanza = st.stanza("message", { a = "a" });
21 21
22 local stanza2 = deserialize(st.preserialize(stanza)); 22 local stanza2 = deserialize(st.preserialize(stanza));
23 assert_is(stanza2 and stanza.name, "deserialize returns a stanza"); 23 assert_is(stanza2 and stanza.name, "deserialize returns a stanza");
24 assert_table(stanza2.attr, "Deserialized stanza has attributes"); 24 assert_table(stanza2.attr, "Deserialized stanza has attributes");
25 assert_equal(stanza2.attr.a, "a", "Deserialized stanza retains attributes"); 25 assert_equal(stanza2.attr.a, "a", "Deserialized stanza retains attributes");
26 assert_table(getmetatable(stanza2), "Deserialized stanza has metatable"); 26 assert_table(getmetatable(stanza2), "Deserialized stanza has metatable");