Skip to content

Commit db8adb9

Browse files
committed
Update tests
1 parent 4d9b68c commit db8adb9

File tree

2 files changed

+45
-21
lines changed

2 files changed

+45
-21
lines changed

apps/els_lsp/test/els_completion_SUITE.erl

+28-12
Original file line numberDiff line numberDiff line change
@@ -1772,18 +1772,27 @@ resolve_application_remote_otp(Config) ->
17721772
case has_eep48(file) of
17731773
true when OtpRelease >= 27 ->
17741774
<<
1775-
"## file:write/2\n\n"
1776-
"---\n\n```erlang\n\n"
1777-
" write(File, Bytes) when is_pid(File) orelse is_atom(File)\n\n"
1778-
" write(#file_descriptor{module = Module} = Handle, Bytes) \n\n"
1779-
" write(_, _) \n\n"
1780-
"```\n\n"
17811775
"```erlang\n"
1782-
"-spec write(IoDevice, Bytes) -> ok | {error, Reason} when\n"
1776+
"write(IoDevice, Bytes) -> ok | {error, Reason} when\n"
17831777
" IoDevice :: io_device() | io:device(),\n"
17841778
" Bytes :: iodata(),\n"
17851779
" Reason :: posix() | badarg | terminated.\n"
1786-
"```"
1780+
"```\n\n"
1781+
"---\n\n"
1782+
"```erlang\n"
1783+
"Writes `Bytes` to the file referenced by `IoDevice`. "
1784+
"This function is the only\nway to write to a file opened in"
1785+
" `raw` mode (although it works for normally\nopened files"
1786+
" too). Returns `ok` if successful, and `{error, Reason}`"
1787+
" otherwise.\n\nIf the file is opened with `encoding` set to"
1788+
" something else than `latin1`, each\nbyte written can result"
1789+
" in many bytes being written to the file, as the byte\nrange"
1790+
" 0..255 can represent anything between one and four bytes"
1791+
" depending on\nvalue and UTF encoding type. If you want to"
1792+
" write `t:unicode:chardata/0` to the\n`IoDevice` you should"
1793+
" use `io:put_chars/2` instead.\n\nTypical error reasons:\n\n"
1794+
"- **`ebadf`** - The file is not opened for writing.\n\n"
1795+
"- **`enospc`** - No space is left on the device.\n```\n"
17871796
>>;
17881797
true when OtpRelease == 26 ->
17891798
<<
@@ -2001,10 +2010,17 @@ resolve_type_application_remote_otp(Config) ->
20012010
case has_eep48(file) of
20022011
true when OtpRelease >= 27 ->
20032012
<<
2004-
"```erlang\n"
2005-
"-type name_all() :: string() | atom() | deep_list() |"
2006-
" (RawFilename :: binary()).\n"
2007-
"```"
2013+
"```erlang\nname_all()\n```\n\n---\n\n"
2014+
"```erlang\nA file name used as input into `m:file` API"
2015+
" functions.\n\nIf VM is in Unicode filename mode,"
2016+
" characters are allowed to be > 255.\n`RawFilename`"
2017+
" is a filename not subject to Unicode translation,"
2018+
" meaning that it\ncan contain characters not conforming"
2019+
" to the Unicode encoding expected from the\nfile system"
2020+
" (that is, non-UTF-8 characters although the VM is"
2021+
" started in Unicode\nfilename mode). Null characters"
2022+
" (integer value zero) are _not_ allowed in\nfilenames"
2023+
" (not even at the end).\n```\n"
20082024
>>;
20092025
true ->
20102026
<<

apps/els_lsp/test/els_hover_SUITE.erl

+17-9
Original file line numberDiff line numberDiff line change
@@ -215,17 +215,25 @@ remote_call_otp(Config) ->
215215
case has_eep48(file) of
216216
true when OtpRelease >= 27 ->
217217
<<
218-
"## file:write/2\n\n---\n\n"
219-
"```erlang\n\n write(File, Bytes) when is_pid(File) orelse is_atom(File)\n\n"
220-
" write(#file_descriptor{module = Module} = Handle, Bytes) \n\n"
221-
" write(_, _) \n\n"
222-
"```\n\n"
223-
"```erlang\n"
224-
"-spec write(IoDevice, Bytes) -> ok | {error, Reason} when\n"
225-
" IoDevice :: io_device() | io:device(),\n"
218+
"```erlang\nwrite(IoDevice, Bytes) -> ok | {error, Reason}"
219+
" when\n IoDevice :: io_device() | io:device(),\n"
226220
" Bytes :: iodata(),\n"
227221
" Reason :: posix() | badarg | terminated.\n"
228-
"```"
222+
"```\n\n---\n\n"
223+
"```erlang\nWrites `Bytes` to the file referenced by"
224+
" `IoDevice`. This function is the only\nway to write to a"
225+
" file opened in `raw` mode (although it works for normally\n"
226+
"opened files too). Returns `ok` if successful, and"
227+
" `{error, Reason}` otherwise.\n\nIf the file is opened with"
228+
" `encoding` set to something else than `latin1`, each\nbyte"
229+
" written can result in many bytes being written to the file,"
230+
" as the byte\nrange 0..255 can represent anything between"
231+
" one and four bytes depending on\nvalue and UTF encoding"
232+
" type. If you want to write `t:unicode:chardata/0` to the\n"
233+
"`IoDevice` you should use `io:put_chars/2` instead.\n\n"
234+
"Typical error reasons:\n\n"
235+
"- **`ebadf`** - The file is not opened for writing.\n\n"
236+
"- **`enospc`** - No space is left on the device.\n```\n"
229237
>>;
230238
true when OtpRelease == 26 ->
231239
<<

0 commit comments

Comments
 (0)