1395
1395
test.add_fallback_versioned_files(basis)
1397
1397
def test_add_lines(self):
1398
# lines added to the test are not added to the basis
1399
basis, test = self.get_basis_and_test_knit()
1401
key_basis = ('bar',)
1402
key_cross_border = ('quux',)
1403
key_delta = ('zaphod',)
1404
test.add_lines(key, (), ['foo\n'])
1405
self.assertEqual({}, basis.get_parent_map([key]))
1406
# lines added to the test that reference across the stack do a
1408
basis.add_lines(key_basis, (), ['foo\n'])
1410
test.add_lines(key_cross_border, (key_basis,), ['foo\n'])
1411
self.assertEqual('fulltext', test._index.get_method(key_cross_border))
1412
self.assertEqual([("get_parent_map", set([key_basis]))], basis.calls)
1414
# Subsequent adds do delta.
1415
test.add_lines(key_delta, (key_cross_border,), ['foo\n'])
1416
self.assertEqual('line-delta', test._index.get_method(key_delta))
1417
self.assertEqual([], basis.calls)
1400
1419
def test_annotate(self):
1401
1420
# annotations from the test knit are answered without asking the basis