Skip to content

Commit 930582b

Browse files
improve test
1 parent cc5540b commit 930582b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

integration_test/pg/prepare_test.exs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,18 @@ defmodule Ecto.Integration.PrepareTest do
88
one = TestRepo.insert!(%Post{title: "one"})
99
two = TestRepo.insert!(%Post{title: "two"})
1010

11+
stmt_count_query = "SHOW GLOBAL STATUS LIKE '%prepared_stmt_count%'"
12+
1113
# Uncached
1214
assert TestRepo.all(Post, prepare: :unnamed) == [one, two]
15+
assert %{rows: [[0]]} = TestRepo.query(stmt_count_query, [])
1316
assert TestRepo.all(Post, prepare: :named) == [one, two]
17+
assert %{rows: [[1]]} = TestRepo.query(stmt_count_query, [])
1418

1519
# Cached
1620
assert TestRepo.all(Post, prepare: :unnamed) == [one, two]
21+
assert %{rows: [[1]]} = TestRepo.query(stmt_count_query, [])
1722
assert TestRepo.all(Post, prepare: :named) == [one, two]
23+
assert %{rows: [[1]]} = TestRepo.query(stmt_count_query, [])
1824
end
1925
end

0 commit comments

Comments
 (0)