File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -299,6 +299,31 @@ vspSpec = do
299
299
, " putStrLn \" hello world\" "
300
300
]
301
301
302
+ it " converts code units to code points" $ do
303
+ let
304
+ orig = unlines
305
+ [ " a𐐀b"
306
+ , " a𐐀b"
307
+ ]
308
+ vfile = VirtualFile 0 0 (fromString orig)
309
+
310
+ positionToCodePointPosition vfile (J. Position 1 0 )`shouldBe` Just (CodePointPosition 1 0 )
311
+ positionToCodePointPosition vfile (J. Position 1 1 )`shouldBe` Just (CodePointPosition 1 1 )
312
+ positionToCodePointPosition vfile (J. Position 1 2 )`shouldBe` Nothing
313
+ positionToCodePointPosition vfile (J. Position 1 3 )`shouldBe` Just (CodePointPosition 1 2 )
314
+
315
+ it " converts code points to code units" $ do
316
+ let
317
+ orig = unlines
318
+ [ " a𐐀b"
319
+ , " a𐐀b"
320
+ ]
321
+ vfile = VirtualFile 0 0 (fromString orig)
322
+
323
+ codePointPositionToPosition vfile (CodePointPosition 1 0 )`shouldBe` J. Position 1 0
324
+ codePointPositionToPosition vfile (CodePointPosition 1 1 )`shouldBe` J. Position 1 1
325
+ codePointPositionToPosition vfile (CodePointPosition 1 2 )`shouldBe` J. Position 1 3
326
+
302
327
-- ---------------------------------
303
328
304
329
it " getCompletionPrefix" $ do
You can’t perform that action at this time.
0 commit comments