Vcaml_test_helpersval with_client :
?args:string list ->
?env:([> `Tmpdir of string ] -> Core_unix.env) ->
?links:(string * [ `In_path_as | `In_temp_as ] * string) list ->
?time_source:Async.Time_source.t ->
?on_error:[ `Raise | `Call of Vcaml.Vcaml_error.t -> unit ] ->
?before_connecting:(Vcaml.Client.Not_connected.t -> unit Async.Deferred.t) ->
?verbose:bool ->
?warn_if_neovim_exits_early:bool ->
([ `asynchronous ] Vcaml.Client.t -> 'a Async.Deferred.Or_error.t) ->
'a Async.Deferred.tLaunch an embedded Neovim instance and persist the connection for the duration of the callback. If verbose is set, a dump of the traffic between VCaml and Neovim will be printed, which is often helpful for debugging problems. You may see repeated API calls for nvim_get_current_buf and nvim_eval "0" - these are used by VCaml for flushing the Neovim event loop and heartbeating Neovim respectively. verbose works even with integration tests in which Neovim launches the plugin - both traffic between the test client and Neovim and traffic between Neovim and the plugin are displayed.
val print_s : ?mach:unit -> Async.Sexp.t -> unitShadow print_s to elide the test's temporary directory in the output. This is useful when the current working directory would appear in test output, e.g., in tests that display the name of the current buffer.
val with_ui_client :
?width:int ->
?height:int ->
?args:string list ->
?env:([> `Tmpdir of string ] -> Core_unix.env) ->
?links:(string * [ `In_path_as | `In_temp_as ] * string) list ->
?time_source:Async.Time_source.t ->
?on_error:[ `Raise | `Call of Vcaml.Vcaml_error.t -> unit ] ->
?before_connecting:(Vcaml.Client.Not_connected.t -> unit Async.Deferred.t) ->
?verbose:bool ->
?warn_if_neovim_exits_early:bool ->
([ `asynchronous ] Vcaml.Client.t ->
Test_ui.t ->
'a Async.Deferred.Or_error.t) ->
'a Async.Deferred.tSame as with_client, but also attaches a UI to receive UI events from Neovim. This lets you embed a visual representation of Neovim in your expect test.
val get_screen_contents : Test_ui.t -> string Async.Deferred.Or_error.tGet the current screen contents. If you want to confirm that desired text has appeared on the screen before proceeding, use wait_until_text instead.
val wait_until_text :
?timeout:Core.Time_ns.Span.t ->
here:lexing_position ->
Test_ui.t ->
f:(string -> bool) ->
string Async.Deferred.Or_error.tWait until text satisfying f is rendered in the Neovim UI, then return the screen contents.
val socket_client :
?time_source:Async.Time_source.t ->
?on_error:[ `Raise | `Call of Vcaml.Vcaml_error.t -> unit ] ->
?before_connecting:(Vcaml.Client.Not_connected.t -> unit Async.Deferred.t) ->
?verbose:bool ->
string ->
[ `asynchronous ] Vcaml.Client.t Async.Deferred.Or_error.tThis function is for advanced tests that require a unix domain socket. Be sure to close the client when finished with the test. If you are reaching for this to visually debug a failing test, use For_debugging.with_ui_client instead.
module For_debugging : sig ... endIf a test is behaving in a way that is especially surprising, use this module to attach it to an Neovim instance you are running so you can observe the effect. Note that the client detaching at the end of the test may be too rapid for you to view the effects - you may want to add a delay before returning.
module Private : sig ... end