package ee.shy.core.merge;

import ee.shy.TemporaryDirectory;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;

import java.io.IOException;

import static org.junit.Assume.*;

public abstract class MergerTest<T> {
    @Rule
    public TemporaryDirectory temporaryDirectory = new TemporaryDirectory();

    protected T patchable;
    protected T original;
    protected T revised;
    protected T patched;

    protected abstract T getState(String name) throws IOException;

    @Before
    public void setUp() throws Exception {
        patchable = getState("patchable");
        original = getState("original");
        revised = getState("revised");
        patched = getState("patched");
        assumeNotNull(patchable, original, revised, patchable);
    }

    @Test
    public void testForwardMainMerge() throws Exception {
        testMerge(patchable, original, revised, patched);
    }

    @Test
    public void testForwardSideMerge() throws Exception {
        testMerge(revised, original, patchable, patched);
    }

    @Test
    public void testBackwardMainMerge() throws Exception {
        testMerge(patched, revised, original, patchable);
    }

    @Test
    public void testBackwardSideMerge() throws Exception {
        testMerge(original, revised, patched, patchable);
    }

    protected abstract void testMerge(T patchable, T original, T revised, T patched) throws IOException;
}

@@ -1126,24 +1126,35 @@
   testMerge(
+patchable, 
 patched, rev
@@ -1167,27 +1167,16 @@
 original
-, patchable
 );%0A    %7D
@@ -1264,26 +1264,16 @@
 stMerge(
-original, 
 revised,
@@ -1283,32 +1283,42 @@
 tched, patchable
+, original
 );%0A    %7D%0A%0A    pr

Fix backward merge test object order