{
  "schema": "https://bars.commonsware.com/conformance/schema/render-fixture.schema.json",
  "version": "0.1.0",
  "cases": [
    {
      "name": "round-half-rounds-up",
      "spotlight": true,
      "description": "A positive half rounds away from zero via {{ n | round }}.",
      "template": "{{ n | round }}",
      "context": {
        "n": 2.5
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "3"
      }
    },
    {
      "name": "round-negative-half-rounds-away",
      "description": "A negative half rounds away from zero.",
      "template": "{{ n | round }}",
      "context": {
        "n": -2.5
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "-3"
      }
    },
    {
      "name": "round-below-half-rounds-down",
      "description": "A value below the half rounds down.",
      "template": "{{ n | round }}",
      "context": {
        "n": 2.4
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "2"
      }
    },
    {
      "name": "round-integer-unchanged",
      "description": "round of an integer is unchanged.",
      "template": "{{ n | round }}",
      "context": {
        "n": 7
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "7"
      }
    },
    {
      "name": "round-one-decimal-place",
      "spotlight": true,
      "description": "round with a places argument keeps that many decimals via {{ n | round: 1 }}.",
      "template": "{{ n | round: 1 }}",
      "context": {
        "n": 1.46
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "1.5"
      }
    },
    {
      "name": "round-two-decimal-places",
      "description": "round with two decimal places.",
      "template": "{{ n | round: 2 }}",
      "context": {
        "n": 0.246
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "0.25"
      }
    },
    {
      "name": "round-non-numeric-input-is-null",
      "description": "A non-numeric input is a soft failure, so round yields null.",
      "template": "{{ n | round }}",
      "context": {
        "n": "x"
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    },
    {
      "name": "round-negative-places-is-null",
      "description": "A negative places argument is a soft failure, so round yields null.",
      "template": "{{ n | round: -1 }}",
      "context": {
        "n": 5
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    },
    {
      "name": "round-non-integer-places-is-null",
      "description": "A non-integer places argument is a soft failure, so round yields null.",
      "template": "{{ n | round: \"x\" }}",
      "context": {
        "n": 5
      },
      "expect": {
        "kind": "output",
        "expectedOutput": "null"
      }
    },
    {
      "name": "round-two-args-is-error",
      "description": "Calling round with two arguments produces an arity error.",
      "template": "{{ n | round: 1 2 }}",
      "context": {
        "n": 5
      },
      "expect": {
        "kind": "error",
        "errorCode": "KB-2002"
      }
    }
  ]
}
