Author: rdonch
Date: Tue Aug  3 23:18:36 2010
New Revision: 982064

URL: http://svn.apache.org/viewvc?rev=982064&view=rev
Log:
* subversion/bindings/swig/python/tests/delta.py:
  (DeltaTestCase.testTxdeltaWindowT): New test to cover the fix made in
    r981683 and r981701.


Modified:
    subversion/trunk/subversion/bindings/swig/python/tests/delta.py

Modified: subversion/trunk/subversion/bindings/swig/python/tests/delta.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/python/tests/delta.py?rev=982064&r1=982063&r2=982064&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/python/tests/delta.py (original)
+++ subversion/trunk/subversion/bindings/swig/python/tests/delta.py Tue Aug  3 
23:18:36 2010
@@ -46,6 +46,21 @@ class DeltaTestCase(unittest.TestCase):
     window_handler, baton = \
        svn.delta.tx_apply(src_stream, target_stream, None)
     window_handler(None, baton)
+    
+  def testTxdeltaWindowT(self):
+    """Test the svn_txdelta_window_t wrapper."""
+    a = StringIO("abc\ndef\n")
+    b = StringIO("def\nghi\n")
+    
+    delta_stream = svn.delta.svn_txdelta(a, b)
+    window = svn.delta.svn_txdelta_next_window(delta_stream)
+    
+    self.assert_(window.sview_offset + window.sview_len <= len(a.getvalue()))
+    self.assert_(window.tview_len <= len(b.getvalue()))
+    self.assert_(len(window.new_data) > 0)
+    self.assertEqual(window.num_ops, len(window.ops))
+    self.assertEqual(window.src_ops, len([op for op in window.ops
+      if op.action_code == svn.delta.svn_txdelta_source]))
 
 def suite():
   return unittest.defaultTestLoader.loadTestsFromTestCase(DeltaTestCase)


Reply via email to