st
unicodeMovement i = "Unicode movement" ~:
    [ "separate" ~: utf8Test i [utf8 "α", utf8 "\ESC[Dx"]
        [prompt 0, utf8 "α", utf8 "\bxα\b"]
    , "coalesced" ~: utf8Test i [utf8 "α\ESC[Dx"]
        [prompt 0, utf8 "xα\b"]
    , "lineWrap" ~: utf8Test i
        [ utf8 longWideChar
        , raw [1]
        , raw [5]
        ]
        [prompt 0, utf8 lwc1 <> wrap <> utf8 lwc2 <> wrap <> utf8 lwc3
        , cr <> "\ESC[2A\ESC[2C"
        , cr <> nl <> nl <> "\ESC[22C"
        ]

    ]
  where
    longWideChar = T.concat $ replicate 30 $ "안기영"
    (lwc1,lwcs1) = T.splitAt ((80-2)`div`2) longWideChar
    (lwc2,lwcs2) = T.splitAt (80`div`2) lwcs1
    (lwc3,_lwcs3) = T.splitAt (80`div`2) lwcs2
    -- lwc3 has length 90 - (80-2)/2 - 80/2 = 11,
    -- so the last line as wide width 2*11=22.

tabCompletion :: Invocation -> Test
tabCompl
unicodeMovement :: Invocation -> Test
unicodeMovement i = "Unicode movement" ~:
    [ "separate" ~: utf8Test i [utf8 "α", utf8 "\ESC[Dx"]
        [prompt 0, utf8 "α", utf8 "\bxα\b"]
    , "coalesced" ~: utf8Test i [utf8 "α\ESC[Dx"]
        [prompt 0, utf8 "xα\b"]
    , "lineWrap" ~: utf8Test i
        [ utf8 longWideChar
        , raw [1]
        , raw [5]
        ]
        [prompt 0, utf8 lwc1 <> wrap <> utf8 lwc2 <> wrap <> utf8 lwc3
        , cr <> "\ESC[2A\ESC[2C"
        , cr <> nl <> nl <> "\ESC[22C"
        ]

    ]
  where
    longWideChar = T.concat $ replicate 30 $ "안기영"
    (lwc1,lwcs1) = T.splitAt ((80-2)`div`2) longWideChar
    (lwc2,lwcs2) = T.splitAt (80`div`2) lwcs1
    (lwc3,_lwcs3) = T.splitAt (80`div`2) lwcs2
    -- lwc3 has length 90 - (80-2)/2 - 80/2 = 11,
    -- so the last line as wide width 2*11=22.
unicodeMovement i = "Unicode movement" ~:
    [ "separate" ~: utf8Test i [utf8 "α", utf8 "\ESC[Dx"]
        [prompt 0, utf8 "α", utf8 "\bxα\b"]
    , "coalesced" ~: utf8Test i [utf8 "α\ESC[Dx"]
        [prompt 0, utf8 "xα\b"]
    , "lineWrap" ~: utf8Test i
        [ utf8 longWideChar
        , raw [1]
        , raw [5]
        ]
        [prompt 0, utf8 lwc1 <> wrap <> utf8 lwc2 <> wrap <> utf8 lwc3
        , cr <> "\ESC[2A\ESC[2C"
        , cr <> nl <> nl <> "\ESC[22C"
        ]

    ]
  where
    longWideChar = T.concat $ replicate 30 $ "안기영"
    (lwc1,lwcs1) = T.splitAt ((80-2)`div`2) longWideChar
    (lwc2,lwcs2) = T.splitAt (80`div`2) lwcs1
    (lwc3,_lwcs3) = T.splitAt (80`div`2) lwcs2
    -- lwc3 has length 90 - (80-2)/2 - 80/2 = 11,
    -- so the last line as wide width 2*11=22.