Skip to content

Commit

Permalink
Support Elixir 1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerWitt committed Jan 10, 2025
1 parent 9efff67 commit 1c1f61f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions test/ecto/query/builder_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ defmodule Ecto.Query.BuilderTest do

test "escape parameterized types" do
parameterized_type = Ecto.ParameterizedType.init(ParameterizedPrefixedString, prefix: "p")
assert {Macro.escape(quote do type(&0.y(), unquote(parameterized_type)) end), []} ==
escape(quote do type(field(x, :y), unquote(parameterized_type)) end, [x: 0], __ENV__)
assert {Macro.escape(quote do type(&0.y(), unquote(Macro.escape(parameterized_type))) end), []} ==
escape(quote do type(field(x, :y), unquote(Macro.escape(parameterized_type))) end, [x: 0], __ENV__)
end

defmacro wrapped_sum(a) do
Expand Down
4 changes: 2 additions & 2 deletions test/ecto/query_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ defmodule Ecto.QueryTest do

test "casts queryable to query" do
assert_raise Protocol.UndefinedError,
~r"protocol Ecto.Queryable not implemented for \[\]",
~r"protocol Ecto.Queryable not implemented for.* type List",
fn -> has_named_binding?([], :posts) end
end

Expand Down Expand Up @@ -1144,7 +1144,7 @@ defmodule Ecto.QueryTest do

test "casts queryable to query" do
assert_raise Protocol.UndefinedError,
~r"protocol Ecto.Queryable not implemented for \[\]",
~r"protocol Ecto.Queryable not implemented for.* type List",
fn -> with_named_binding([], :posts, & &1) end
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/ecto/schema_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ defmodule Ecto.SchemaTest do
end

test "embedded schema does not have metadata" do
refute match?(%{__meta__: _}, %EmbeddedSchema{})
refute :__meta__ in Map.keys(%EmbeddedSchema{})
end

test "embedded redacted_fields" do
Expand Down
6 changes: 3 additions & 3 deletions test/support/test_repo.exs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ defmodule Ecto.TestAdapter do
def insert(_, %{context: nil, prefix: prefix} = meta, fields, on_conflict, returning, _opts) do
meta = Map.merge(meta, %{fields: fields, on_conflict: on_conflict, returning: returning, prefix: prefix})
send(self(), {:insert, meta})
{:ok, Enum.zip(returning, 1..length(returning))}
{:ok, Enum.zip(returning, 1..length(returning)//1)}
end

def insert(_, %{context: context}, _fields, _on_conflict, _returning, _opts) do
Expand All @@ -110,7 +110,7 @@ defmodule Ecto.TestAdapter do
def update(_, %{context: nil} = meta, [_ | _] = changes, filters, returning, _opts) do
meta = Map.merge(meta, %{changes: changes, filters: filters, returning: returning})
send(self(), {:update, meta})
{:ok, Enum.zip(returning, 1..length(returning))}
{:ok, Enum.zip(returning, 1..length(returning)//1)}
end

def update(_, %{context: context}, [_ | _], _filters, _returning, _opts) do
Expand All @@ -120,7 +120,7 @@ defmodule Ecto.TestAdapter do
def delete(_, %{context: nil} = meta, filters, returning, _opts) do
meta = Map.merge(meta, %{filters: filters, returning: returning})
send(self(), {:delete, meta})
{:ok, Enum.zip(returning, 1..length(returning))}
{:ok, Enum.zip(returning, 1..length(returning)//1)}
end

def delete(_, %{context: context}, _filters, _returning, _opts) do
Expand Down

0 comments on commit 1c1f61f

Please sign in to comment.