Add test for previous commit
authorMatthew Wild <mwild1@gmail.com>
Fri, 9 Jan 2009 17:36:28 +0000 (17:36 +0000)
committerMatthew Wild <mwild1@gmail.com>
Fri, 9 Jan 2009 17:36:28 +0000 (17:36 +0000)
tests/test.lua
tests/test_util_stanza.lua [new file with mode: 0644]

index eb209219c1d35aa3405f3758b399c2d7ed419c7e..bc1e19793bf68ec69dbd7ec4c05286e39079c360 100644 (file)
@@ -25,7 +25,8 @@ function run_all_tests()
        dotest "core.stanza_router"
        dotest "core.s2smanager"
        dotest "core.configmanager"
-       
+       dotest "util.stanza"
+               
        dosingletest("test_sasl.lua", "latin1toutf8");
 end
 
diff --git a/tests/test_util_stanza.lua b/tests/test_util_stanza.lua
new file mode 100644 (file)
index 0000000..897dab9
--- /dev/null
@@ -0,0 +1,7 @@
+
+function deserialize(deserialize, st)
+       local stanza = st.stanza("message", { a = "a" });
+       
+       local stanza2 = deserialize(st.preserialize(stanza));
+       assert_is(stanza2.last_add, "Deserialized stanza is missing last_add for adding child tags");
+end