Skip to content

chore: add tests for the Duration form of the datetime expressions - #814

Merged
zachdaniel merged 1 commit into
ash-project:mainfrom
matt-beanland:test/duration-expressions
Aug 14, 2026
Merged

chore: add tests for the Duration form of the datetime expressions#814
zachdaniel merged 1 commit into
ash-project:mainfrom
matt-beanland:test/duration-expressions

Conversation

@matt-beanland

Copy link
Copy Markdown
Contributor

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • I accept the AI Policy, or AI was not used in the creation of this PR.
  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

Summary

Tests only. Covers ago/1, from_now/1, datetime_add/2 and date_add/2 with a Duration, including a multi-unit duration and a negative one, and checks that date_add still compares as a date.

These pass only with the corresponding ash_sql change; against released ash_sql they fail with Unsupported expression. Part of #553

Tested with Postgres 19.

Notes

requires ash-project/ash#2844 for from_now/1
requires ash-project/ash_sql#245

Covers `ago/1`, `from_now/1`, `datetime_add/2` and `date_add/2` with a `Duration`,
including a multi-unit duration and a negative one, and checks that `date_add` still
compares as a date.

These pass only with the corresponding ash_sql change; against released ash_sql all
six fail with `Unsupported expression`. Part of ash-project#553.
@zachdaniel
zachdaniel merged commit deea7b8 into ash-project:main Aug 14, 2026
121 of 126 checks passed
@zachdaniel

Copy link
Copy Markdown
Contributor

🚀 Thank you for your contribution! 🚀

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.

2 participants