---
cases:
  - note: time/add_date year month day
    query: data.generated.p = x
    modules:
      - |
        package generated

        p := __local0__ if {
        	time.add_date(1585852421593912000, 3, 9, 12, __local1__)
        	__local0__ = __local1__
        }
    want_result:
      - x: 1705257221593912000
  - note: time/add_date too large result
    query: data.generated.p = x
    modules:
      - |
        package generated

        p := ns if {
        	time.add_date(0, 2262, 1, 1, ns)
        }
    want_error_code: eval_builtin_error
    want_error: time outside of valid range
    strict_error: true
