From 745732ed0433de8e446a6550ae1dbd87676cdde7 Mon Sep 17 00:00:00 2001 From: Olle Fredriksson Date: Sat, 10 Feb 2018 12:39:59 +0100 Subject: [PATCH] Add test for utf-16 codepoints in change ranges --- test/VspSpec.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/VspSpec.hs b/test/VspSpec.hs index 15b1dd3b3..e977eaf4c 100644 --- a/test/VspSpec.hs +++ b/test/VspSpec.hs @@ -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" + ]