Skip to content

Commit 745732e

Browse files
committed
Add test for utf-16 codepoints in change ranges
1 parent 98c079e commit 745732e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/VspSpec.hs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,3 +248,15 @@ vspSpec = do
248248
, "baz ="
249249
, " putStrLn \"hello world\""
250250
]
251+
it "indexes using utf-16 codepoints" $ do
252+
let
253+
orig = unlines
254+
[ "a𐐀b"
255+
, "a𐐀b"
256+
]
257+
new = applyChange (fromString orig)
258+
$ J.TextDocumentContentChangeEvent (mkRange 1 0 1 3) (Just 3) "𐐀𐐀"
259+
lines (Rope.toString new) `shouldBe`
260+
[ "a𐐀b"
261+
, "𐐀𐐀b"
262+
]

0 commit comments

Comments
 (0)