# Position format tests for go-yaml CLI

- name: Single character position
  text: |
    a
  TOKEN: |
    - {token: STREAM-START, pos: '1:1'}
    - {token: SCALAR, value: a, pos: '1:1-2'}
    - {token: STREAM-END, pos: '2:1'}

- name: |
    Same line range
  text: |
    key: value
  TOKEN: |
    - {token: STREAM-START, pos: '1:1'}
    - {token: BLOCK-MAPPING-START, pos: '1:1'}
    - {token: KEY, pos: '1:1'}
    - {token: SCALAR, value: key, pos: '1:1-4'}
    - {token: VALUE, pos: '1:4-5'}
    - {token: SCALAR, value: value, pos: '1:6-11'}
    - {token: BLOCK-END, pos: '2:1'}
    - {token: STREAM-END, pos: '2:1'}

- name: |
    Multi-line literal scalar
  text: |
    key: |
      line1
      line2
  TOKEN: |
    - {token: STREAM-START, pos: '1:1'}
    - {token: BLOCK-MAPPING-START, pos: '1:1'}
    - {token: KEY, pos: '1:1'}
    - {token: SCALAR, value: key, pos: '1:1-4'}
    - {token: VALUE, pos: '1:4-5'}
    - {token: SCALAR, value: "line1\nline2\n", style: Literal, pos: '1:6-4:1'}
    - {token: BLOCK-END, pos: '4:1'}
    - {token: STREAM-END, pos: '4:1'}

- name: |
    Comment position with line comment
  text: |
    a: b #c
  TOKEN: |
    - {token: STREAM-START, pos: '1:1'}
    - {token: BLOCK-MAPPING-START, pos: '1:1'}
    - {token: KEY, pos: '1:1'}
    - {token: SCALAR, value: a, pos: '1:1-2'}
    - {token: VALUE, pos: '1:2-3'}
    - {token: COMMENT, line: '#c', pos: '1:6-8'}
    - {token: SCALAR, value: b, pos: '1:4-5'}
    - {token: BLOCK-END, pos: '2:1'}
    - {token: STREAM-END, pos: '2:1'}
