add tests for the merge function