~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_chk_map.py

CHKInventory core tests passing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
243
243
        self.assertEqual([(("foo bar",), "baz"), (("quux",), "blarh")],
244
244
            sorted(node.iteritems(None)))
245
245
 
 
246
    def test_deserialise_item_with_null_width_1(self):
 
247
        node = LeafNode.deserialise(
 
248
            "chkleaf:\n0\n1\n2\nfoo\x00bar\x00baz\nquux\x00blarh\n",
 
249
            ("sha1:1234",))
 
250
        self.assertEqual(2, len(node))
 
251
        self.assertEqual([(("foo",), "bar\x00baz"), (("quux",), "blarh")],
 
252
            sorted(node.iteritems(None)))
 
253
 
 
254
    def test_deserialise_item_with_null_width_2(self):
 
255
        node = LeafNode.deserialise(
 
256
            "chkleaf:\n0\n2\n2\nfoo\x001\x00bar\x00baz\nquux\x00\x00blarh\n",
 
257
            ("sha1:1234",))
 
258
        self.assertEqual(2, len(node))
 
259
        self.assertEqual([(("foo", "1"), "bar\x00baz"), (("quux", ""), "blarh")],
 
260
            sorted(node.iteritems(None)))
 
261
 
246
262
    def test_iteritems_selected_one_of_two_items(self):
247
263
        node = LeafNode.deserialise(
248
264
            "chkleaf:\n0\n1\n2\nfoo bar\x00baz\nquux\x00blarh\n", ("sha1:1234",))