Skip to content

Commit 026553b

Browse files
test(stdlib): update file error snapshots
The typed Erlang file boundary now reports that format_error returns a character list. FileInput and FileOutput convert that value to an Elixir string before they build an error message. Update the three stdlib fixtures that generate those modules. Each fixture was compiled with the repository-pinned Reflaxe library and matched its intended output.
1 parent f03e19c commit 026553b

6 files changed

Lines changed: 6 additions & 6 deletions

File tree

test/snapshot/stdlib/sys_filesystem/intended/sys/io/file_input.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ defmodule Sys.IO.FileInput do
6868
Bytes.of_data(elem(tagged, 1))
6969
end
7070
defp throw_file_error(operation, result) do
71-
raise Reflaxe.Elixir.HaxeThrow, [value: "File " <> operation <> " error: " <> :file.format_error(elem(result, 1))]
71+
raise Reflaxe.Elixir.HaxeThrow, [value: "File " <> operation <> " error: " <> List.to_string(:file.format_error(elem(result, 1)))]
7272
end
7373
def set_big_endian(struct, b) do
7474
Input.set_big_endian(struct, b)

test/snapshot/stdlib/sys_filesystem/intended/sys/io/file_output.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ defmodule Sys.IO.FileOutput do
5252
if (raw_result != :ok), do: throw_file_error("write", result)
5353
end
5454
defp throw_file_error(operation, result) do
55-
raise Reflaxe.Elixir.HaxeThrow, [value: "File " <> operation <> " error: " <> :file.format_error(elem(result, 1))]
55+
raise Reflaxe.Elixir.HaxeThrow, [value: "File " <> operation <> " error: " <> List.to_string(:file.format_error(elem(result, 1)))]
5656
end
5757
def set_big_endian(struct, b) do
5858
Output.set_big_endian(struct, b)

test/snapshot/stdlib/sys_ssl_digest/intended/sys/io/file_input.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ defmodule Sys.IO.FileInput do
6868
Bytes.of_data(elem(tagged, 1))
6969
end
7070
defp throw_file_error(operation, result) do
71-
raise Reflaxe.Elixir.HaxeThrow, [value: "File " <> operation <> " error: " <> :file.format_error(elem(result, 1))]
71+
raise Reflaxe.Elixir.HaxeThrow, [value: "File " <> operation <> " error: " <> List.to_string(:file.format_error(elem(result, 1)))]
7272
end
7373
def set_big_endian(struct, b) do
7474
Input.set_big_endian(struct, b)

test/snapshot/stdlib/sys_ssl_digest/intended/sys/io/file_output.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ defmodule Sys.IO.FileOutput do
5252
if (raw_result != :ok), do: throw_file_error("write", result)
5353
end
5454
defp throw_file_error(operation, result) do
55-
raise Reflaxe.Elixir.HaxeThrow, [value: "File " <> operation <> " error: " <> :file.format_error(elem(result, 1))]
55+
raise Reflaxe.Elixir.HaxeThrow, [value: "File " <> operation <> " error: " <> List.to_string(:file.format_error(elem(result, 1)))]
5656
end
5757
def set_big_endian(struct, b) do
5858
Output.set_big_endian(struct, b)

test/snapshot/stdlib/sys_ssl_socket_surfaces/intended/sys/io/file_input.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ defmodule Sys.IO.FileInput do
6868
Bytes.of_data(elem(tagged, 1))
6969
end
7070
defp throw_file_error(operation, result) do
71-
raise Reflaxe.Elixir.HaxeThrow, [value: "File " <> operation <> " error: " <> :file.format_error(elem(result, 1))]
71+
raise Reflaxe.Elixir.HaxeThrow, [value: "File " <> operation <> " error: " <> List.to_string(:file.format_error(elem(result, 1)))]
7272
end
7373
def set_big_endian(struct, b) do
7474
Input.set_big_endian(struct, b)

test/snapshot/stdlib/sys_ssl_socket_surfaces/intended/sys/io/file_output.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ defmodule Sys.IO.FileOutput do
5252
if (raw_result != :ok), do: throw_file_error("write", result)
5353
end
5454
defp throw_file_error(operation, result) do
55-
raise Reflaxe.Elixir.HaxeThrow, [value: "File " <> operation <> " error: " <> :file.format_error(elem(result, 1))]
55+
raise Reflaxe.Elixir.HaxeThrow, [value: "File " <> operation <> " error: " <> List.to_string(:file.format_error(elem(result, 1)))]
5656
end
5757
def set_big_endian(struct, b) do
5858
Output.set_big_endian(struct, b)

0 commit comments

Comments
 (0)