---
cases:
  - note: uuid-parse/positive-v4
    data: {}
    modules:
      - |
        package test

        p = uuid.parse(input.userid)

    input: { "userid": "00000000-0000-4000-8000-000000000000" }
    query: data.test.p = x
    want_result:
      - x:
          version: 4
          variant: "RFC4122"

  - note: uuid-parse/positive-v2
    data: {}
    modules:
      - |
        package test

        p = uuid.parse(input.userid)

    input: { "userid": "000003e8-48b9-21ee-b200-325096b39f47" }
    query: data.test.p = x
    want_result:
      - x:
          version: 2
          variant: "RFC4122"
          nodeid: "32-50-96-b3-9f-47"
          macvariables: "local:unicast"
          time: 1693566990121469600
          clocksequence: 12800
          domain: "Person"
          id: 1000

  - note: uuid-parse/positive-v3
    data: {}
    modules:
      - |
        package test

        p = uuid.parse(input.userid)

    input: { "userid": "38074da4-0b00-388d-9c3c-362de965547a" }
    query: data.test.p = x
    want_result:
      - x:
          version: 3
          variant: "RFC4122"

  - note: uuid-parse/negative
    data: {}
    modules:
      - |
        package test

        p = uuid.parse(input.userid)

    input: { "userid": "123" }
    query: data.test.p = x
    want_result: []
