Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Rychlewski authored and Greg Rychlewski committed Jul 6, 2024
1 parent 0069665 commit 2a03855
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/calendar_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,13 @@ defmodule CalendarTest do
] = query("SELECT timestamp with time zone '1981-01-01BC 00:00:00.123456'", [])
end

test "decode timestamptz out of bounds", context do
%Postgrex.Error{postgres: %{message: message}} =
query("SELECT timestamp with time zone '4714-01-01BC 00:00:00.123456'", [])

assert message =~ "timestamp out of range"
end

@tag :capture_log
test "decode infinity", context do
assert_raise ArgumentError, fn -> query("SELECT 'infinity'::timestamp", []) end
Expand Down

0 comments on commit 2a03855

Please sign in to comment.