Skip to content

Commit 9b4cbd1

Browse files
committed
Update tests
1 parent ff0077c commit 9b4cbd1

File tree

2 files changed

+43
-21
lines changed

2 files changed

+43
-21
lines changed

apps/els_lsp/test/els_completion_SUITE.erl

+26-12
Original file line numberDiff line numberDiff line change
@@ -1790,18 +1790,25 @@ resolve_application_remote_otp(Config) ->
17901790
case has_eep48(file) of
17911791
true when OtpRelease >= 27 ->
17921792
<<
1793-
"## file:write/2\n\n"
1794-
"---\n\n```erlang\n\n"
1795-
" write(File, Bytes) when is_pid(File) orelse is_atom(File)\n\n"
1796-
" write(#file_descriptor{module = Module} = Handle, Bytes) \n\n"
1797-
" write(_, _) \n\n"
1798-
"```\n\n"
17991793
"```erlang\n"
1800-
"-spec write(IoDevice, Bytes) -> ok | {error, Reason} when\n"
1794+
"write(IoDevice, Bytes) -> ok | {error, Reason} when\n"
18011795
" IoDevice :: io_device() | io:device(),\n"
18021796
" Bytes :: iodata(),\n"
18031797
" Reason :: posix() | badarg | terminated.\n"
1804-
"```"
1798+
"```\n\n---\n\n```"
1799+
"erlang\nWrites `Bytes` to the file referenced by `IoDevice`."
1800+
" This function is the only\nway to write to a file opened in"
1801+
" `raw` mode (although it works for normally\nopened files"
1802+
" too). Returns `ok` if successful, and `{error, Reason}`"
1803+
" otherwise.\n\nIf the file is opened with `encoding` set to"
1804+
" something else than `latin1`, each\nbyte written can result"
1805+
" in many bytes being written to the file, as the byte\nrange"
1806+
" 0..255 can represent anything between one and four bytes"
1807+
" depending on\nvalue and UTF encoding type. If you want to"
1808+
" write `t:unicode:chardata/0` to the\n`IoDevice` you should"
1809+
" use `io:put_chars/2` instead.\n\nTypical error reasons:\n\n"
1810+
"- **`ebadf`** - The file is not opened for writing.\n\n"
1811+
"- **`enospc`** - No space is left on the device.\n```\n"
18051812
>>;
18061813
true when OtpRelease == 26 ->
18071814
<<
@@ -2019,10 +2026,17 @@ resolve_type_application_remote_otp(Config) ->
20192026
case has_eep48(file) of
20202027
true when OtpRelease >= 27 ->
20212028
<<
2022-
"```erlang\n"
2023-
"-type name_all() :: string() | atom() | deep_list() |"
2024-
" (RawFilename :: binary()).\n"
2025-
"```"
2029+
"```erlang\nname_all()\n```\n\n---\n\n"
2030+
"```erlang\nA file name used as input into `m:file` API"
2031+
" functions.\n\nIf VM is in Unicode filename mode,"
2032+
" characters are allowed to be > 255.\n`RawFilename`"
2033+
" is a filename not subject to Unicode translation,"
2034+
" meaning that it\ncan contain characters not conforming"
2035+
" to the Unicode encoding expected from the\nfile system"
2036+
" (that is, non-UTF-8 characters although the VM is"
2037+
" started in Unicode\nfilename mode). Null characters"
2038+
" (integer value zero) are _not_ allowed in\nfilenames"
2039+
" (not even at the end).\n```\n"
20262040
>>;
20272041
true ->
20282042
<<

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)