testTextInsertTextDelete :: TestTree
testTextInsertTextDelete =
  let ti1 = O.TextInsert 0 'x' 0
      td1 = O.TextDelete 0
      ti2 = O.TextInsert 1 'y' 0
      td2 = O.TextDelete 1 in
  testGroup "TextInsert vs TextDelete"
  [ testCase "Delete >= Insert" $ do
      assertEqual "a" (Just ti1) $ T.transform ti1 td1 T.Left
      assertEqual "b" (Just ti1) $ T.transform ti1 td1 T.Right
      assertEqual "c" (Just ti1) $ T.transform ti1 td2 T.Left
      assertEqual "d" (Just ti1) $ T.transform ti1 td2 T.Right
  , testCase "Delete < Insert" $ do
      assertEqual "a" (Just $ O.TextInsert 0 'y' 0) $ T.transform ti2 td1 T.Left
      assertEqual "b" (Just $ O.TextInsert 0 'y' 0) $ T.transform ti2 td1 T.Right
  ]
testTextInsertTextDelete :: TestTree
testTextInsertTextDelete =
  let ti1 = O.TextInsert 0 'x' 0
      td1 = O.TextDelete 0
      ti2 = O.TextInsert 1 'y' 0
      td2 = O.TextDelete 1 in
  testGroup "TextInsert vs TextDelete"
  [ testCase "Delete >= Insert" $ do
      assertEqual "a" (Just ti1) $ T.transform ti1 td1 T.Left
      assertEqual "b" (Just ti1) $ T.transform ti1 td1 T.Right
      assertEqual "c" (Just ti1) $ T.transform ti1 td2 T.Left
      assertEqual "d" (Just ti1) $ T.transform ti1 td2 T.Right
  , testCase "Delete < Insert" $ do
      assertEqual "a" (Just $ O.TextInsert 0 'y' 0) $ T.transform ti2 td1 T.Left
      assertEqual "b" (Just $ O.TextInsert 0 'y' 0) $ T.transform ti2 td1 T.Right
  ]
testTextInsertTextDelete =
  let ti1 = O.TextInsert 0 'x' 0
      td1 = O.TextDelete 0
      ti2 = O.TextInsert 1 'y' 0
      td2 = O.TextDelete 1 in
  testGroup "TextInsert vs TextDelete"
  [ testCase "Delete >= Insert" $ do
      assertEqual "a" (Just ti1) $ T.transform ti1 td1 T.Left
      assertEqual "b" (Just ti1) $ T.transform ti1 td1 T.Right
      assertEqual "c" (Just ti1) $ T.transform ti1 td2 T.Left
      assertEqual "d" (Just ti1) $ T.transform ti1 td2 T.Right
  , testCase "Delete < Insert" $ do
      assertEqual "a" (Just $ O.TextInsert 0 'y' 0) $ T.transform ti2 td1 T.Left
      assertEqual "b" (Just $ O.TextInsert 0 'y' 0) $ T.transform ti2 td1 T.Right
  ]