Add new test for inverting branches