[MERGE] Shelf 1 / 5: TreeTransform serialization

Aaron Bentley aaron at aaronbentley.com
Sat Oct 18 14:35:55 BST 2008

Hash: SHA1

John Arbash Meinel wrote:
> All of these tests look like they are testing that you can "round-trip"
> a tree transform (eg deserialize(serialize()) works). But AFAICT you
> never test the bytes-on-disk. Which means that we aren't really testing
> stability between versions.

I've been thinking about this, and I don't think I actually care about
the bytes on disk.  This code makes no assertions about what serializer
it's handed.  It would be easy to reimplement the Pack interfaces on top
of bencode or just on top of a list.

ShelfManager and Unshelver will depend on the serialization being in a
particular format, but they appear in later threads.

> I think it would be good to test "serialize()" separately from
> "deserialize()" to help ensure that things get written the same way over
> time.

Yet I agree that some direct tests of serialize and deserialize make sense.

Rather than bytes on disk, they should be testing how the serialization
API is used.  We already have plenty of tests to ensure that using the
pack API produces the correct output.

So deserialize can be exercised by passing in a manually-constructed
list of records.  serialize can be exercised with an implementation of
Pack that simply creates a list of records.

Does that seem right to you?

Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the bazaar mailing list