Skip to content

Commit

Permalink
Add test for utf-16 codepoints in change ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
ollef committed Feb 11, 2018
1 parent 98c079e commit 745732e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/VspSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -248,3 +248,15 @@ vspSpec = do
, "baz ="
, " putStrLn \"hello world\""
]
it "indexes using utf-16 codepoints" $ do
let
orig = unlines
[ "a𐐀b"
, "a𐐀b"
]
new = applyChange (fromString orig)
$ J.TextDocumentContentChangeEvent (mkRange 1 0 1 3) (Just 3) "𐐀𐐀"
lines (Rope.toString new) `shouldBe`
[ "a𐐀b"
, "𐐀𐐀b"
]

0 comments on commit 745732e

Please sign in to comment.