If students have changed their answer to fit the old (incorrect) test cases then their most resent submission would be marked as wrong. However, if they had an early submission that was correct (for the updated test cases) then they would get full marks for that submission. Once a student has a correct submission their mark for a question can not go down with subsequent submissions. This gives students the freedom to try different things once they have gotten the question right with out having to worry about losing marks.
However, the student will always see the result table for their most recent submission which may now show up as failing test cases if you have changed them and done a regrade. This may cause some confusion. For this reason, it can sometimes be best to run the regrade on a selection of students who are being affected by the mistake in the test case, if this is possible. But sometimes regrading all students will be the only option.