Skip to content

Commit

Permalink
cleanup test
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Rychlewski authored and Greg Rychlewski committed Jul 1, 2024
1 parent 5557326 commit f85f28c
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions test/query_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -1760,18 +1760,10 @@ defmodule QueryTest do

assert [row1, row2] = query("SELECT * FROM timestamps", [])

assert [
%{microsecond: {_, 6}},
%{microsecond: {_, 3}},
%{microsecond: {_, 0}},
[%{microsecond: {_, 0}}, %{microsecond: {_, 0}}]
] = row1

assert [
%{microsecond: {_, 6}},
%{microsecond: {_, 3}},
%{microsecond: {_, 0}},
[%{microsecond: {_, 0}}, %{microsecond: {_, 0}}]
] = row2
assert [6, 3, 0, [0, 0]] = precision(row1)
assert [6, 3, 0, [0, 0]] = precision(row2)
end

defp precision([_ | _] = dts), do: Enum.map(dts, &precision(&1))
defp precision(%NaiveDateTime{microsecond: {_, p}}), do: p
end

0 comments on commit f85f28c

Please sign in to comment.