testSequenceInsertSequenceInsert :: TestTree
testSequenceInsertSequenceInsert = 
  let si1 = O.SequenceInsert 0 c 0
      si2 = O.SequenceInsert 0 c 1
      si3 = O.SequenceInsert 0 c 0
      si4 = O.SequenceInsert 1 c 10 in
  testGroup "SequenceInsert vs SequenceInsert"
  [ testCase "Wins tiebreaker" $ do
      assertEqual "a" (Just si2) $ T.transform si2 si1 T.Left
      assertEqual "b" (Just si2) $ T.transform si2 si1 T.Right
      assertEqual "c" (Just si1) $ T.transform si1 si3 T.Right
  , testCase "Loses tiebreaker" $ do
      assertEqual "a" (Just $ O.SequenceInsert 1 c 0) $ T.transform si1 si2 T.Left
      assertEqual "b" (Just $ O.SequenceInsert 1 c 0) $ T.transform si1 si2 T.Right
      assertEqual "c" (Just $ O.SequenceInsert 1 c 0) $ T.transform si1 si3 T.Left
  , testCase "Not affected" $ do
      assertEqual "a" (Just si1) $ T.transform si1 si4 T.Left
      assertEqual "b" (Just si1) $ T.transform si1 si4 T.Right
  , testCase "Index incremented" $ do
      assertEqual "a" (Just $ O.SequenceInsert 2 c 10) $ T.transform si4 si1 T.Left
      assertEqual "b" (Just $ O.SequenceInsert 2 c 10) $ T.transform si4 si1 T.Right
  ]
testSequenceInsertSequenceInsert :: TestTree
testSequenceInsertSequenceInsert = 
  let si1 = O.SequenceInsert 0 c 0
      si2 = O.SequenceInsert 0 c 1
      si3 = O.SequenceInsert 0 c 0
      si4 = O.SequenceInsert 1 c 10 in
  testGroup "SequenceInsert vs SequenceInsert"
  [ testCase "Wins tiebreaker" $ do
      assertEqual "a" (Just si2) $ T.transform si2 si1 T.Left
      assertEqual "b" (Just si2) $ T.transform si2 si1 T.Right
      assertEqual "c" (Just si1) $ T.transform si1 si3 T.Right
  , testCase "Loses tiebreaker" $ do
      assertEqual "a" (Just $ O.SequenceInsert 1 c 0) $ T.transform si1 si2 T.Left
      assertEqual "b" (Just $ O.SequenceInsert 1 c 0) $ T.transform si1 si2 T.Right
      assertEqual "c" (Just $ O.SequenceInsert 1 c 0) $ T.transform si1 si3 T.Left
  , testCase "Not affected" $ do
      assertEqual "a" (Just si1) $ T.transform si1 si4 T.Left
      assertEqual "b" (Just si1) $ T.transform si1 si4 T.Right
  , testCase "Index incremented" $ do
      assertEqual "a" (Just $ O.SequenceInsert 2 c 10) $ T.transform si4 si1 T.Left
      assertEqual "b" (Just $ O.SequenceInsert 2 c 10) $ T.transform si4 si1 T.Right
  ]
testSequenceInsertSequenceInsert = 
  let si1 = O.SequenceInsert 0 c 0
      si2 = O.SequenceInsert 0 c 1
      si3 = O.SequenceInsert 0 c 0
      si4 = O.SequenceInsert 1 c 10 in
  testGroup "SequenceInsert vs SequenceInsert"
  [ testCase "Wins tiebreaker" $ do
      assertEqual "a" (Just si2) $ T.transform si2 si1 T.Left
      assertEqual "b" (Just si2) $ T.transform si2 si1 T.Right
      assertEqual "c" (Just si1) $ T.transform si1 si3 T.Right
  , testCase "Loses tiebreaker" $ do
      assertEqual "a" (Just $ O.SequenceInsert 1 c 0) $ T.transform si1 si2 T.Left
      assertEqual "b" (Just $ O.SequenceInsert 1 c 0) $ T.transform si1 si2 T.Right
      assertEqual "c" (Just $ O.SequenceInsert 1 c 0) $ T.transform si1 si3 T.Left
  , testCase "Not affected" $ do
      assertEqual "a" (Just si1) $ T.transform si1 si4 T.Left
      assertEqual "b" (Just si1) $ T.transform si1 si4 T.Right
  , testCase "Index incremented" $ do
      assertEqual "a" (Just $ O.SequenceInsert 2 c 10) $ T.transform si4 si1 T.Left
      assertEqual "b" (Just $ O.SequenceInsert 2 c 10) $ T.transform si4 si1 T.Right
  ]