From db8adb92b106e8f4ddaa6edc52c787e7e3724936 Mon Sep 17 00:00:00 2001 From: Hakan Nilsson Date: Tue, 1 Oct 2024 23:32:15 +0200 Subject: [PATCH] Update tests --- apps/els_lsp/test/els_completion_SUITE.erl | 40 +++++++++++++++------- apps/els_lsp/test/els_hover_SUITE.erl | 26 +++++++++----- 2 files changed, 45 insertions(+), 21 deletions(-) diff --git a/apps/els_lsp/test/els_completion_SUITE.erl b/apps/els_lsp/test/els_completion_SUITE.erl index df9054a6..accc6ec0 100644 --- a/apps/els_lsp/test/els_completion_SUITE.erl +++ b/apps/els_lsp/test/els_completion_SUITE.erl @@ -1772,18 +1772,27 @@ 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\n" + "Writes `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 -> << @@ -2001,10 +2010,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 -> << diff --git a/apps/els_lsp/test/els_hover_SUITE.erl b/apps/els_lsp/test/els_hover_SUITE.erl index 343e7917..9e06a4f9 100644 --- a/apps/els_lsp/test/els_hover_SUITE.erl +++ b/apps/els_lsp/test/els_hover_SUITE.erl @@ -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 -> <<