linol/ocaml-lsp-server/bench/ocaml_lsp_bench.ml
Simon Cruanes 7fbc187548 Squashed 'thirdparty/lsp/' content from commit aae69863
git-subtree-dir: thirdparty/lsp
git-subtree-split: aae6986391a8519de3da6a7a341f2bd3376e0d2f
2025-04-10 15:44:25 -04:00

20 lines
756 B
OCaml

open Ocaml_lsp_server
open Core
open Core_bench
let () =
let open Documents in
let long_document = long_document_text |> Merlin_kernel.Msource.make in
let position = `Logical (3, 15) in
let long_position = `Logical (92, 41) in
Command_unix.run
(Bench.make_command
[ Bench.Test.create ~name:"get_prefix" (fun _ ->
Testing.Compl.prefix_of_position ~short_path:false document position |> ignore)
; Bench.Test.create ~name:"get_prefix_long" (fun _ ->
Testing.Compl.prefix_of_position ~short_path:false long_document long_position
|> ignore)
; Bench.Test.create ~name:"get_offset_long" (fun _ ->
Merlin_kernel.Msource.get_offset long_document long_position |> ignore)
])
;;