mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
* Partially implement Go's time format * Parse date only values * Fix leap year handling in `time.diff` * Disable failing test case
41 lines
1.0 KiB
YAML
41 lines
1.0 KiB
YAML
# Copyright (c) Microsoft Corporation.
|
|
# Licensed under the MIT License.
|
|
|
|
cases:
|
|
- note: parse
|
|
data: {}
|
|
modules:
|
|
- |
|
|
package test
|
|
|
|
a := time.parse_ns("2006-01-02T15:04:05", "2016-05-10T19:06:42")
|
|
b := time.parse_ns("2006-01-02 15:04:05", "2015-09-05 23:56:04")
|
|
query: data.test
|
|
want_result:
|
|
a: 1462907202000000000
|
|
b: 1441497364000000000
|
|
|
|
- note: format-and-parse-back
|
|
data: {}
|
|
modules:
|
|
- |
|
|
package test
|
|
|
|
a := res {
|
|
date := time.format([1703444325734390000, "UTC", "2006-01-02T15:04:05.999999999"])
|
|
res := time.parse_ns("2006-01-02T15:04:05.999999999", date)
|
|
}
|
|
query: data.test
|
|
want_result:
|
|
a: 1703444325734390000
|
|
|
|
- note: invalid-type
|
|
data: {}
|
|
modules:
|
|
- |
|
|
package test
|
|
|
|
a := time.parse_ns("2006-01-02T15:04:05.999999999", 1703444325734390000)
|
|
query: data.test
|
|
error: '`time.parse_ns` expects string argument. Got `1703444325734390000` instead'
|