Monday, 13 December 2010

Loading Func

This is the test case for Func

        [Test]
        def load_func():
                source = detab("""
                        <func>
                                function lua_func()
                                        print "lua stuff"
                                end
                                --
                                -- need to call the function - like a
                                -- normal lua program in that respect
                                --
                                lua_func()
                        </func>
                """)
                using r = XmlReader.Create(StringReader(source)):
                        r.ReadToFollowing("func")
                        func = Func()
                        func.load(r)
                        assert func.code == source

I should do a version with lots of odd chars embedded in it, just to make sure entity conversion kicks in and doesn't break the XML.

But let's do the simple case first

No comments: