---
cases:
  - data:
    modules:
      - |
        package generated

        p = x {
          substring("aaa", -1, -1, x)
        }
    note: "strings/substring: offset negative"
    query: data.generated.p = x
    want_error: negative offset
    want_error_code: eval_builtin_error
    strict_error: true
  - modules:
      - |
        package generated

        p = x {
          substring("åäö", -1, -1, x)
        }
    note: "strings/substring: offset negative unicode"
    query: data.generated.p = x
    want_error: negative offset
    want_error_code: eval_builtin_error
    strict_error: true
