Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion test/ecto/adapters/sqlite3/connection_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2370,9 +2370,20 @@ defmodule Ecto.Adapters.SQLite3.ConnectionTest do
end

test "create table with an unsupported type" do
msg =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think it is fine to just return the multi string error message regardless of OTP version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message afaik is not in our control. The difference is due to improvments on error messages for NIFs and BIFs, which are part of OTP24.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see. I don't think inside the NIF we raise any exceptions there, just return atom error tuples. 👍🏻

if :erlang.system_info(:otp_release) >= '24' do
"""
errors were found at the given arguments:

* 1st argument: not an atom
"""
else
"argument error"
end

assert_raise(
ArgumentError,
"argument error",
msg,
fn ->
{:create, table(:posts),
[
Expand Down