================================================================================
basic/intseq
================================================================================

amends "../snippetTest.pkl"

import "pkl:math"

local seq1 = IntSeq(0, -1)
local seq2 = IntSeq(0, -2)
local seq3 = IntSeq(10, -10)

facts {
  ["equality"] {
    seq1 == seq2
    seq2 == seq1
    seq2 == seq3
    seq3 == seq2
    seq3 == seq1
    seq1 == seq3

    IntSeq(-10, 10) == IntSeq(-10, 10)
    !(IntSeq(-10, 10) == IntSeq(10, -10).step(-1))
    !(IntSeq(-10, 10) == IntSeq(-10, 10).step(2))

    IntSeq(-10, 10).step(2) == IntSeq(-10, 11).step(2)
    IntSeq(-10, 10).step(5) == IntSeq(-10, 14).step(5)
    !(IntSeq(-10, 10).step(5) == IntSeq(-10, 15).step(5))

    IntSeq(10, -10).step(-2) == IntSeq(10, -11).step(-2)
    IntSeq(10, -10).step(-5) == IntSeq(10, -14).step(-5)
    !(IntSeq(10, -10).step(-5) == IntSeq(10, -15).step(-5))

    IntSeq(math.minInt, math.maxInt) == IntSeq(math.minInt, math.maxInt)
    !(IntSeq(math.minInt, math.maxInt) == IntSeq(math.maxInt, math.minInt))
  }
}

--------------------------------------------------------------------------------

(module
  (moduleHeader
    (extendsOrAmendsClause
      (stringConstant)))
  (importClause
    (stringConstant))
  (classProperty
    (modifier)
    (identifier)
    (methodCallExpr
      (identifier)
      (argumentList
        (intLiteral)
        (unaryExpr
          (intLiteral)))))
  (classProperty
    (modifier)
    (identifier)
    (methodCallExpr
      (identifier)
      (argumentList
        (intLiteral)
        (unaryExpr
          (intLiteral)))))
  (classProperty
    (modifier)
    (identifier)
    (methodCallExpr
      (identifier)
      (argumentList
        (intLiteral)
        (unaryExpr
          (intLiteral)))))
  (classProperty
    (identifier)
    (objectBody
      (objectEntry
        (slStringLiteral)
        (objectBody
          (objectElement
            (binaryExpr
              (variableExpr
                (identifier))
              (variableExpr
                (identifier))))
          (objectElement
            (binaryExpr
              (variableExpr
                (identifier))
              (variableExpr
                (identifier))))
          (objectElement
            (binaryExpr
              (variableExpr
                (identifier))
              (variableExpr
                (identifier))))
          (objectElement
            (binaryExpr
              (variableExpr
                (identifier))
              (variableExpr
                (identifier))))
          (objectElement
            (binaryExpr
              (variableExpr
                (identifier))
              (variableExpr
                (identifier))))
          (objectElement
            (binaryExpr
              (variableExpr
                (identifier))
              (variableExpr
                (identifier))))
          (objectElement
            (binaryExpr
              (methodCallExpr
                (identifier)
                (argumentList
                  (unaryExpr
                    (intLiteral))
                  (intLiteral)))
              (methodCallExpr
                (identifier)
                (argumentList
                  (unaryExpr
                    (intLiteral))
                  (intLiteral)))))
          (objectElement
            (unaryExpr
              (parenthesizedExpr
                (methodCallExpr
                  (binaryExpr
                    (methodCallExpr
                      (identifier)
                      (argumentList
                        (unaryExpr
                          (intLiteral))
                        (intLiteral)))
                    (methodCallExpr
                      (identifier)
                      (argumentList
                        (intLiteral)
                        (unaryExpr
                          (intLiteral)))))
                  (identifier)
                  (argumentList
                    (unaryExpr
                      (intLiteral)))))))
          (objectElement
            (unaryExpr
              (parenthesizedExpr
                (methodCallExpr
                  (binaryExpr
                    (methodCallExpr
                      (identifier)
                      (argumentList
                        (unaryExpr
                          (intLiteral))
                        (intLiteral)))
                    (methodCallExpr
                      (identifier)
                      (argumentList
                        (unaryExpr
                          (intLiteral))
                        (intLiteral))))
                  (identifier)
                  (argumentList
                    (intLiteral))))))
          (objectElement
            (methodCallExpr
              (binaryExpr
                (methodCallExpr
                  (methodCallExpr
                    (identifier)
                    (argumentList
                      (unaryExpr
                        (intLiteral))
                      (intLiteral)))
                  (identifier)
                  (argumentList
                    (intLiteral)))
                (methodCallExpr
                  (identifier)
                  (argumentList
                    (unaryExpr
                      (intLiteral))
                    (intLiteral))))
              (identifier)
              (argumentList
                (intLiteral))))
          (objectElement
            (methodCallExpr
              (binaryExpr
                (methodCallExpr
                  (methodCallExpr
                    (identifier)
                    (argumentList
                      (unaryExpr
                        (intLiteral))
                      (intLiteral)))
                  (identifier)
                  (argumentList
                    (intLiteral)))
                (methodCallExpr
                  (identifier)
                  (argumentList
                    (unaryExpr
                      (intLiteral))
                    (intLiteral))))
              (identifier)
              (argumentList
                (intLiteral))))
          (objectElement
            (unaryExpr
              (parenthesizedExpr
                (methodCallExpr
                  (binaryExpr
                    (methodCallExpr
                      (methodCallExpr
                        (identifier)
                        (argumentList
                          (unaryExpr
                            (intLiteral))
                          (intLiteral)))
                      (identifier)
                      (argumentList
                        (intLiteral)))
                    (methodCallExpr
                      (identifier)
                      (argumentList
                        (unaryExpr
                          (intLiteral))
                        (intLiteral))))
                  (identifier)
                  (argumentList
                    (intLiteral))))))
          (objectElement
            (methodCallExpr
              (binaryExpr
                (methodCallExpr
                  (methodCallExpr
                    (identifier)
                    (argumentList
                      (intLiteral)
                      (unaryExpr
                        (intLiteral))))
                  (identifier)
                  (argumentList
                    (unaryExpr
                      (intLiteral))))
                (methodCallExpr
                  (identifier)
                  (argumentList
                    (intLiteral)
                    (unaryExpr
                      (intLiteral)))))
              (identifier)
              (argumentList
                (unaryExpr
                  (intLiteral)))))
          (objectElement
            (methodCallExpr
              (binaryExpr
                (methodCallExpr
                  (methodCallExpr
                    (identifier)
                    (argumentList
                      (intLiteral)
                      (unaryExpr
                        (intLiteral))))
                  (identifier)
                  (argumentList
                    (unaryExpr
                      (intLiteral))))
                (methodCallExpr
                  (identifier)
                  (argumentList
                    (intLiteral)
                    (unaryExpr
                      (intLiteral)))))
              (identifier)
              (argumentList
                (unaryExpr
                  (intLiteral)))))
          (objectElement
            (unaryExpr
              (parenthesizedExpr
                (methodCallExpr
                  (binaryExpr
                    (methodCallExpr
                      (methodCallExpr
                        (identifier)
                        (argumentList
                          (intLiteral)
                          (unaryExpr
                            (intLiteral))))
                      (identifier)
                      (argumentList
                        (unaryExpr
                          (intLiteral))))
                    (methodCallExpr
                      (identifier)
                      (argumentList
                        (intLiteral)
                        (unaryExpr
                          (intLiteral)))))
                  (identifier)
                  (argumentList
                    (unaryExpr
                      (intLiteral)))))))
          (objectElement
            (binaryExpr
              (methodCallExpr
                (identifier)
                (argumentList
                  (propertyCallExpr
                    (variableExpr
                      (identifier))
                    (identifier))
                  (propertyCallExpr
                    (variableExpr
                      (identifier))
                    (identifier))))
              (methodCallExpr
                (identifier)
                (argumentList
                  (propertyCallExpr
                    (variableExpr
                      (identifier))
                    (identifier))
                  (propertyCallExpr
                    (variableExpr
                      (identifier))
                    (identifier))))))
          (objectElement
            (unaryExpr
              (parenthesizedExpr
                (binaryExpr
                  (methodCallExpr
                    (identifier)
                    (argumentList
                      (propertyCallExpr
                        (variableExpr
                          (identifier))
                        (identifier))
                      (propertyCallExpr
                        (variableExpr
                          (identifier))
                        (identifier))))
                  (methodCallExpr
                    (identifier)
                    (argumentList
                      (propertyCallExpr
                        (variableExpr
                          (identifier))
                        (identifier))
                      (propertyCallExpr
                        (variableExpr
                          (identifier))
                        (identifier)))))))))))))
