---
"Script errors contain position":
  - requires:
      cluster_features: ["gte_v7.7.1"]
      reason: "position introduced in 7.7"

  - do:
      catch: /compile error/
      put_script:
        id: "1"
        context: "score"
        body: { "script": {"lang": "painless", "source": "_score * foo bar + doc['myParent.weight'].value"} }
  - match: { error.root_cause.0.position.offset: 13 }
  - match: { error.root_cause.0.position.start: 0 }
  - match: { error.root_cause.0.position.end: 38 }
