Skip to content

Commit 3183b70

Browse files
author
spicychickensauce
committed
Ensure test works across multiple OTP versions
1 parent 2054a79 commit 3183b70

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/ecto/adapters/sqlite3/connection/join_test.exs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,12 @@ defmodule Ecto.Adapters.SQLite3.Connection.JoinTest do
153153
|> select([p, q], {p.id, q.x})
154154
|> plan()
155155

156+
# We can't hardcode the columns of the CTE here,
157+
# as the order changes for different Map implementations for OTP 25 and later
158+
col_names = Map.keys(types) |> Enum.join(", ")
159+
156160
assert ~s{SELECT s0."id", v1."x" FROM "schema" AS s0 } <>
157-
~s{INNER JOIN (WITH temp_78027(y, x) AS (VALUES ($1,$2),($3,$4)) SELECT * FROM temp_78027) AS v1 } <>
161+
~s{INNER JOIN (WITH temp_78027(#{col_names}) AS (VALUES ($1,$2),($3,$4)) SELECT * FROM temp_78027) AS v1 } <>
158162
~s{ON (v1."x" = s0."x") AND (v1."y" = s0."y")} ==
159163
all(query)
160164
end

0 commit comments

Comments
 (0)