On 24 August 2010 13:33, David Gowers <[email protected]> wrote:
> On Mon, Aug 23, 2010 at 9:42 PM, Ralph Versteegen <[email protected]> wrote:
>> internet connection. Luckily due to git this is no hindrance (I'm
>> completely in love with git now - thanks David!). But I've
> Heh, that makes two of us. (I even use it for versioning art these days :)
>
> BTW, nohrio's RELOAD code actually works now.. 9_9
> As I'm sure you discovered, it was hilariously broken in several
> places (arr.. must write tests before code..!)
> doc/reload.rst does the testing (and demoing)
> -- 'nose --with-doctest doc/reload.rst' runs all the current tests.
> I still can't test it against, say, xml2reload output, because of the
> absurd brokenness of the freebasic package on this system. But the
> tests verify that node nesting, testing RELOAD trees for equality,
> and all node types work.

I tried it out, discovered it was broken, and eventually discovered
that this was due (only) to errors in the RELOAD documentation. Nice
work! Patch attached. It now correctly reads and writes all RELOAD
documents that I threw at it, including the unittest.rld that
reloadtest produces. Also, I reimplemented reload2xml in a couple
lines (MUCH nicer than the 'real' thing :) ), to check that it really
was reading things correctly, and not just that writing was undoing
some kind of error in the read code.

And the string table optimisation really works, it trimmed 1kB off a 15kB file!

I noticed that when testing nodes/trees for equality, you don't
actually look at their values. I suggest comparing the textual
representation of data, so that None == "", and maybe an option for
exact comparison like reloadutil's --pedantic option. Not quite how I
would have designed things, but that's how things worked out: the
official implementation's interface doesn't distinguish between null
and zero-length string nodes.

BTW, why don't the FB packages for your system work? What system is it?

Attachment: 0001-reload-fix-reading-and-writing-of-stringtable.-Readi.patch
Description: Binary data

_______________________________________________
Ohrrpgce mailing list
[email protected]
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

Reply via email to