{
  "cases": [
    {
      "name": "canonicalizes references and collapses exact duplicate",
      "input": {
        "spell_casts": [
          {
            "caster": "  Aria ",
            "spell": " cure   wounds ",
            "source_refs": [
              {"source_id": "source", "start_unit_id": 2, "end_unit_id": 2},
              {"source_id": "source", "start_unit_id": 1, "end_unit_id": 1},
              {"source_id": "source", "start_unit_id": 1, "end_unit_id": 1}
            ]
          },
          {
            "caster": "aria",
            "spell": "Cure Wounds",
            "source_refs": [
              {"source_id": "source", "start_unit_id": 1, "end_unit_id": 1},
              {"source_id": "source", "start_unit_id": 2, "end_unit_id": 2}
            ]
          },
          {
            "caster": "aria",
            "spell": "Cure Wounds",
            "source_refs": [
              {"source_id": "source", "start_unit_id": 2, "end_unit_id": 2}
            ]
          }
        ]
      },
      "output": {
        "spell_casts": [
          {
            "caster": "  Aria ",
            "spell": "Cure Wounds",
            "source_refs": [
              {"source_id": "source", "start_unit_id": 1, "end_unit_id": 1},
              {"source_id": "source", "start_unit_id": 2, "end_unit_id": 2}
            ]
          },
          {
            "caster": "aria",
            "spell": "Cure Wounds",
            "source_refs": [
              {"source_id": "source", "start_unit_id": 2, "end_unit_id": 2}
            ]
          }
        ]
      },
      "warning_reason_codes": [
        "spell_name_canonicalized",
        "source_references_normalized",
        "duplicate_spell_cast_collapsed"
      ]
    },
    {
      "name": "leaves already normalized output unchanged",
      "input": {
        "spell_casts": [
          {
            "caster": "Aria",
            "spell": "Cure Wounds",
            "source_refs": [
              {"source_id": "source", "start_unit_id": 1, "end_unit_id": 1}
            ]
          }
        ]
      },
      "output": {
        "spell_casts": [
          {
            "caster": "Aria",
            "spell": "Cure Wounds",
            "source_refs": [
              {"source_id": "source", "start_unit_id": 1, "end_unit_id": 1}
            ]
          }
        ]
      },
      "warning_reason_codes": []
    }
  ]
}
