---
cases:
  - note: time/format
    query: |
      data.test.a = no_timezone; data.test.b = with_timezone; data.test.c = with_layout; data.test.d = with_constant
    modules:
      - |
        package test

        time_ns := 1670006453141828752

        a := time.format(time_ns)

        b := time.format([time_ns, "Asia/Kolkata"])

        c := time.format([time_ns, "Asia/Kolkata", "Mon Jan 02 15:04:05 -0700 2006"])

        d := time.format([time_ns, "Asia/Kolkata", "RFC1123Z"])
    want_result:
      - no_timezone: "2022-12-02T18:40:53.141828752Z"
        with_constant: Sat, 03 Dec 2022 00:10:53 +0530
        with_layout: Sat Dec 03 00:10:53 +0530 2022
        with_timezone: "2022-12-03T00:10:53.141828752+05:30"
  - note: time/format too big
    query: data.generated.p = x
    modules:
      - |
        package generated

        p := time.format(1582977600 * 10e12)
    want_error_code: eval_builtin_error
    want_error: timestamp too big
    strict_error: true
