mirror of
https://github.com/prometheus/prometheus
synced 2024-12-26 00:23:18 +00:00
PromQL: Add tests for time/date funcs with arg
Add tests for the date and time functions where an argument is specified. Suggested by @grobie: https://github.com/prometheus/prometheus/pull/1984#issuecomment-246508286 `1136239445` is the reference time used by Go: https://golang.org/src/time/format.go
This commit is contained in:
parent
9628eb5998
commit
a0201036fa
18
promql/testdata/functions.test
vendored
18
promql/testdata/functions.test
vendored
@ -370,22 +370,40 @@ clear
|
||||
eval instant at 0m year()
|
||||
{} 1970
|
||||
|
||||
eval instant at 0m year(vector(1136239445))
|
||||
{} 2006
|
||||
|
||||
eval instant at 0m month()
|
||||
{} 1
|
||||
|
||||
eval instant at 0m month(vector(1136239445))
|
||||
{} 1
|
||||
|
||||
eval instant at 0m day_of_month()
|
||||
{} 1
|
||||
|
||||
eval instant at 0m day_of_month(vector(1136239445))
|
||||
{} 2
|
||||
|
||||
# Thursday.
|
||||
eval instant at 0m day_of_week()
|
||||
{} 4
|
||||
|
||||
eval instant at 0m day_of_week(vector(1136239445))
|
||||
{} 1
|
||||
|
||||
eval instant at 0m hour()
|
||||
{} 0
|
||||
|
||||
eval instant at 0m hour(vector(1136239445))
|
||||
{} 22
|
||||
|
||||
eval instant at 0m minute()
|
||||
{} 0
|
||||
|
||||
eval instant at 0m minute(vector(1136239445))
|
||||
{} 4
|
||||
|
||||
# 2008-12-31 23:59:59 just before leap second.
|
||||
eval instant at 0m year(vector(1230767999))
|
||||
{} 2008
|
||||
|
Loading…
Reference in New Issue
Block a user