rewrite tests and test --inplace ignore