You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rd...@apache.org on 2010/08/04 01:18:37 UTC

svn commit: r982064 - /subversion/trunk/subversion/bindings/swig/python/tests/delta.py

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)