#NEWLINE# def test_change_index( ) : #NEWLINE# #INDENT# ( b , y , c , d , z ) = symbols ( 'b, y, c, d, z' , integer = True ) #NEWLINE# assert ( Product ( x , ( x , a , b ) ) . change_index ( x , ( x + 1 ) , y ) == Product ( ( y - 1 ) , ( y , ( a + 1 ) , ( b + 1 ) ) ) ) #NEWLINE# assert ( Product ( ( x ** 2 ) , ( x , a , b ) ) . change_index ( x , ( x - 1 ) ) == Product ( ( ( x + 1 ) ** 2 ) , ( x , ( a - 1 ) , ( b - 1 ) ) ) ) #NEWLINE# assert ( Product ( ( x ** 2 ) , ( x , a , b ) ) . change_index ( x , ( - x ) , y ) == Product ( ( ( - y ) ** 2 ) , ( y , ( - b ) , ( - a ) ) ) ) #NEWLINE# assert ( Product ( x , ( x , a , b ) ) . change_index ( x , ( ( - x ) - 1 ) ) == Product ( ( ( - x ) - 1 ) , ( x , ( ( - b ) - 1 ) , ( ( - a ) - 1 ) ) ) ) #NEWLINE# assert ( Product ( ( x * y ) , ( x , a , b ) , ( y , c , d ) ) . change_index ( x , ( x - 1 ) , z ) == Product ( ( ( z + 1 ) * y ) , ( z , ( a - 1 ) , ( b - 1 ) ) , ( y , c , d ) ) )