Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the get_milliseconds test to match the spec #206

Merged
merged 2 commits into from
Sep 23, 2021

Conversation

TristonianJones
Copy link
Collaborator

@TristonianJones TristonianJones commented Sep 21, 2021

Closes #175

Bug also filed for google/cel-go#453 to address spec conformance.

@@ -325,7 +325,7 @@ section {
}
test {
name: "get_milliseconds"
description: "Need to import a variable to get milliseconds."
description: "Obtain the milliseconds component of the duration. Note, this is not the same as converting the duration to milliseconds. This behavior will be deprecated."
expr: "x.getMilliseconds()"
type_env {
name: "x"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change the seconds: 123 below to seconds: 321? Took me a bit to realize this was only truncating the nanoseconds component to millis. Though to be fair as mentioned, this is not intuitive and will be removed at some point.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem. Updated.

@TristonianJones TristonianJones merged commit c9ae91b into google:master Sep 23, 2021
@TristonianJones TristonianJones deleted the get-milliseconds-fix branch September 23, 2021 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistency in getMilliseconds behaviour
2 participants