Replace assignments in assert with comparison