Skip to content

Commit

Permalink
Add utf-16 change range test
Browse files Browse the repository at this point in the history
This tests indexing around characters encoded as two code units in
UTF-16.
  • Loading branch information
ollef committed Mar 23, 2019
1 parent f31a74f commit 5fd2f49
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 @@ -254,3 +254,15 @@ vspSpec = do
, "baz ="
, " putStrLn \"hello world\""
]
it "indexes using utf-16 code units" $ 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 5fd2f49

Please sign in to comment.