Copied in unit-tests for merge code from 0publish