{
  "schema": "https://bars.commonsware.com/conformance/schema/render-fixture.schema.json",
  "version": "0.1.0",
  "cases": [
    {
      "name": "as_date_time-no-args-milliseconds",
      "spotlight": true,
      "description": "as_date_time with no args interprets input as epoch milliseconds.",
      "template": "{{ ts | as_date_time }}",
      "context": {
        "ts": 2000
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "1970-01-01T00:00:02Z"
      }
    },
    {
      "name": "as_date_time-explicit-milliseconds",
      "description": "as_date_time with 'milliseconds' arg interprets input as epoch milliseconds.",
      "template": "{{ ts | as_date_time: 'milliseconds' }}",
      "context": {
        "ts": 2000
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "1970-01-01T00:00:02Z"
      }
    },
    {
      "name": "as_date_time-seconds",
      "spotlight": true,
      "description": "as_date_time with 'seconds' arg interprets input as epoch seconds.",
      "template": "{{ ts | as_date_time: 'seconds' }}",
      "context": {
        "ts": 5
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "1970-01-01T00:00:05Z"
      }
    },
    {
      "name": "as_date_time-null-input",
      "description": "as_date_time returns null for missing input.",
      "template": "{{ missing | as_date_time }}",
      "context": {},
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    },
    {
      "name": "as_date_time-non-numeric-input",
      "description": "as_date_time returns null for non-numeric string input.",
      "template": "{{ s | as_date_time }}",
      "context": {
        "s": "hello"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    },
    {
      "name": "as_date_time-too-many-args-is-error",
      "description": "as_date_time throws when given more than one argument.",
      "template": "{{ ts | as_date_time: 'milliseconds' 'extra' }}",
      "context": {
        "ts": 1000
      },
      "expect": {
        "kind": "error",
        "errorCode": "KB-2002"
      }
    },
    {
      "name": "as_date_time-unrecognized-unit-is-null",
      "description": "An unrecognized unit argument is a soft failure, so as_date_time yields null.",
      "template": "{{ ts | as_date_time: 'microseconds' }}",
      "context": {
        "ts": 1000
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    }
  ]
}
