Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
plux committed Oct 1, 2024
1 parent 4d9b68c commit 9e894af
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 21 deletions.
38 changes: 26 additions & 12 deletions apps/els_lsp/test/els_completion_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1772,18 +1772,25 @@ resolve_application_remote_otp(Config) ->
case has_eep48(file) of
true when OtpRelease >= 27 ->
<<
"## file:write/2\n\n"
"---\n\n```erlang\n\n"
" write(File, Bytes) when is_pid(File) orelse is_atom(File)\n\n"
" write(#file_descriptor{module = Module} = Handle, Bytes) \n\n"
" write(_, _) \n\n"
"```\n\n"
"```erlang\n"
"-spec write(IoDevice, Bytes) -> ok | {error, Reason} when\n"
"write(IoDevice, Bytes) -> ok | {error, Reason} when\n"
" IoDevice :: io_device() | io:device(),\n"
" Bytes :: iodata(),\n"
" Reason :: posix() | badarg | terminated.\n"
"```"
"```\n\n---\n\n```"
"erlang\nWrites `Bytes` to the file referenced by `IoDevice`."
" This function is the only\nway to write to a file opened in"
" `raw` mode (although it works for normally\nopened files"
" too). Returns `ok` if successful, and `{error, Reason}`"
" otherwise.\n\nIf the file is opened with `encoding` set to"
" something else than `latin1`, each\nbyte written can result"
" in many bytes being written to the file, as the byte\nrange"
" 0..255 can represent anything between one and four bytes"
" depending on\nvalue and UTF encoding type. If you want to"
" write `t:unicode:chardata/0` to the\n`IoDevice` you should"
" use `io:put_chars/2` instead.\n\nTypical error reasons:\n\n"
"- **`ebadf`** - The file is not opened for writing.\n\n"
"- **`enospc`** - No space is left on the device.\n```\n"
>>;
true when OtpRelease == 26 ->
<<
Expand Down Expand Up @@ -2001,10 +2008,17 @@ resolve_type_application_remote_otp(Config) ->
case has_eep48(file) of
true when OtpRelease >= 27 ->
<<
"```erlang\n"
"-type name_all() :: string() | atom() | deep_list() |"
" (RawFilename :: binary()).\n"
"```"
"```erlang\nname_all()\n```\n\n---\n\n"
"```erlang\nA file name used as input into `m:file` API"
" functions.\n\nIf VM is in Unicode filename mode,"
" characters are allowed to be > 255.\n`RawFilename`"
" is a filename not subject to Unicode translation,"
" meaning that it\ncan contain characters not conforming"
" to the Unicode encoding expected from the\nfile system"
" (that is, non-UTF-8 characters although the VM is"
" started in Unicode\nfilename mode). Null characters"
" (integer value zero) are _not_ allowed in\nfilenames"
" (not even at the end).\n```\n"
>>;
true ->
<<
Expand Down
26 changes: 17 additions & 9 deletions apps/els_lsp/test/els_hover_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -215,17 +215,25 @@ remote_call_otp(Config) ->
case has_eep48(file) of
true when OtpRelease >= 27 ->
<<
"## file:write/2\n\n---\n\n"
"```erlang\n\n write(File, Bytes) when is_pid(File) orelse is_atom(File)\n\n"
" write(#file_descriptor{module = Module} = Handle, Bytes) \n\n"
" write(_, _) \n\n"
"```\n\n"
"```erlang\n"
"-spec write(IoDevice, Bytes) -> ok | {error, Reason} when\n"
" IoDevice :: io_device() | io:device(),\n"
"```erlang\nwrite(IoDevice, Bytes) -> ok | {error, Reason}"
" when\n IoDevice :: io_device() | io:device(),\n"
" Bytes :: iodata(),\n"
" Reason :: posix() | badarg | terminated.\n"
"```"
"```\n\n---\n\n"
"```erlang\nWrites `Bytes` to the file referenced by"
" `IoDevice`. This function is the only\nway to write to a"
" file opened in `raw` mode (although it works for normally\n"
"opened files too). Returns `ok` if successful, and"
" `{error, Reason}` otherwise.\n\nIf the file is opened with"
" `encoding` set to something else than `latin1`, each\nbyte"
" written can result in many bytes being written to the file,"
" as the byte\nrange 0..255 can represent anything between"
" one and four bytes depending on\nvalue and UTF encoding"
" type. If you want to write `t:unicode:chardata/0` to the\n"
"`IoDevice` you should use `io:put_chars/2` instead.\n\n"
"Typical error reasons:\n\n"
"- **`ebadf`** - The file is not opened for writing.\n\n"
"- **`enospc`** - No space is left on the device.\n```\n"
>>;
true when OtpRelease == 26 ->
<<
Expand Down

0 comments on commit 9e894af

Please sign in to comment.