@@ -149,22 +149,22 @@ defmodule QueryTest do
149149 assert [ [ % Duration { microsecond: { 0 , 6 } } ] ] =
150150 P . query! ( pid , "SELECT interval '0'" , [ ] ) . rows
151151
152- assert [ [ % Duration { year: 100 , microsecond: { 0 , 6 } } ] ] =
152+ assert [ [ % Duration { month: 1200 , microsecond: { 0 , 6 } } ] ] =
153153 P . query! ( pid , "SELECT interval '100 years'" , [ ] ) . rows
154154
155155 assert [ [ % Duration { month: 10 , microsecond: { 0 , 6 } } ] ] =
156156 P . query! ( pid , "SELECT interval '10 months'" , [ ] ) . rows
157157
158- assert [ [ % Duration { week: 100 , microsecond: { 0 , 6 } } ] ] =
158+ assert [ [ % Duration { day: 700 , microsecond: { 0 , 6 } } ] ] =
159159 P . query! ( pid , "SELECT interval '100 weeks'" , [ ] ) . rows
160160
161161 assert [ [ % Duration { day: 5 , microsecond: { 0 , 6 } } ] ] =
162162 P . query! ( pid , "SELECT interval '5 days'" , [ ] ) . rows
163163
164- assert [ [ % Duration { hour: 100 , microsecond: { 0 , 6 } } ] ] =
164+ assert [ [ % Duration { second: 360_000 , microsecond: { 0 , 6 } } ] ] =
165165 P . query! ( pid , "SELECT interval '100 hours'" , [ ] ) . rows
166166
167- assert [ [ % Duration { minute: 10 , microsecond: { 0 , 6 } } ] ] =
167+ assert [ [ % Duration { second: 600 , microsecond: { 0 , 6 } } ] ] =
168168 P . query! ( pid , "SELECT interval '10 minutes'" , [ ] ) . rows
169169
170170 assert [ [ % Duration { second: 10 , microsecond: { 0 , 6 } } ] ] =
@@ -173,13 +173,9 @@ defmodule QueryTest do
173173 assert [
174174 [
175175 % Duration {
176- year: 1 ,
177- month: 2 ,
178- week: 5 ,
179- day: 5 ,
180- hour: 3 ,
181- minute: 2 ,
182- second: 1 ,
176+ month: 14 ,
177+ day: 40 ,
178+ second: 10921 ,
183179 microsecond: { 0 , 6 }
184180 }
185181 ]
@@ -215,10 +211,10 @@ defmodule QueryTest do
215211 opts = [ database: "postgrex_test" , backoff_type: :stop , types: Postgrex.ElixirDurationTypes ]
216212 { :ok , pid } = P . start_link ( opts )
217213
218- assert [ [ % Duration { week: 1 , day: 3 , microsecond: { 0 , 6 } } ] ] =
214+ assert [ [ % Duration { day: 10 , microsecond: { 0 , 6 } } ] ] =
219215 P . query! ( pid , "SELECT interval '10' DAY" , [ ] ) . rows
220216
221- assert [ [ [ % Duration { week: 1 , day: 3 , microsecond: { 0 , 6 } } ] ] ] =
217+ assert [ [ [ % Duration { day: 10 , microsecond: { 0 , 6 } } ] ] ] =
222218 P . query! ( pid , "SELECT ARRAY[interval '10' DAY]" , [ ] ) . rows
223219 end
224220 end
0 commit comments