From e13f2f11db7bf5e63e2dfc6bc81dd5da529923d5 Mon Sep 17 00:00:00 2001 From: Raoul Gough Date: Thu, 9 Oct 2003 00:05:40 +0000 Subject: [PATCH] Add test for proxy detach during sort (fails on g++ 3.3.1, passes on MSVC) [SVN r20316] --- test/test_vector_proxy.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/test_vector_proxy.py b/test/test_vector_proxy.py index 3398e43f..dcf87966 100644 --- a/test/test_vector_proxy.py +++ b/test/test_vector_proxy.py @@ -75,6 +75,20 @@ >>> v_slice1[0].increment() # Mutate shared object >>> print v_slice1, v_slice2, v[1] # Check reference to same object [8, 9] [8, 6] 4 +>>> v.extend ([8, 7, 6, 5, 4, 3, -1]) # Add new values, including -1 +>>> print [ x for x in v ] +[9, 4, 8, 7, 6, 5, 4, 3, -1] +>>> least_element = v[len(v)-1] # Get proxy for min element +>>> print least_element +-1 +>>> v.sort() # Sort min element to front +>>> print [ x for x in v ] +[-1, 3, 4, 4, 5, 6, 7, 8, 9] +>>> print least_element, v[0] # Check values match +-1 -1 +>>> v[0].increment() # Mutate value in container +>>> print least_element, v[0] # Verify proxy still attached +0 0 ''' def run(args = None):