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

Do not require argument to unixtimestamp function #1191

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

boulter
Copy link
Contributor

@boulter boulter commented Jun 6, 2024

In #1064, the intention was to require arguments for the unixtimestamp filter, but not the function. The unixtimestamp filter just calls the function though, so the requirement was incorrectly applied to both.

@boulter boulter changed the title Do not require arguement to unixtimestamp function Do not require argument to unixtimestamp function Jun 6, 2024
assertThat(Functions.unixtimestamp())
.isGreaterThan(0)
.isLessThanOrEqualTo(System.currentTimeMillis());
assertThat(Functions.unixtimestamp(epochMilliseconds)).isEqualTo(epochMilliseconds);
assertThat(Functions.unixtimestamp(d)).isEqualTo(epochMilliseconds);
assertThat(Functions.unixtimestamp((Object) null))
.isCloseTo(System.currentTimeMillis(), Offset.offset(1000L));
assertThat(jinjavaInterpreter.getErrors()).isEmpty();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this would have caught the errors being thrown that should have only applied to the filter.

@boulter boulter requested a review from hs-lsong June 6, 2024 14:14
@boulter boulter merged commit 7486760 into master Jun 6, 2024
5 checks passed
@boulter boulter deleted the unixtimestampfunc-default branch June 6, 2024 14:29
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.

3 participants