unit tests for rewrite up