================================================================================
projects/project1/basic
================================================================================

amends ".../snippetTest.pkl"

import "@birds/catalog/Ostritch.pkl"
import "@birds/catalog/Swallow.pkl"

examples {
  ["import package"] {
    Ostritch
    Swallow
  }

  ["import module that uses triple-dot import"] {
    import("@birds/some/dir/Bird.pkl")
  }

  ["reading directories"] {
    read("@birds/catalog")
    // Omitting a slash is the package root
    read("@birds")
  }
}

facts {
  ["package-relative dependency is not same import as absolute URI dependency"] {
    import("@birds/Bird.pkl") != import("package://localhost:12110/birds@0.5.0#/Bird.pkl")
  }
  ["package-relative dependency has scheme projectpackage"] {
    import("@birds/Bird.pkl") == import("projectpackage://localhost:12110/birds@0.5.0#/Bird.pkl")
  }
  ["transitive import resolves to same dependency as direct dependency import"] {
    Swallow.favoriteFruit == import("@fruits/catalog/apple.pkl")
  }
  ["transitive import resolves to same dependency as projectpackage import"] {
    Swallow.favoriteFruit == import("projectpackage://localhost:12110/fruit@1.1.0#/catalog/apple.pkl")
    Swallow.favoriteFruit != import("projectpackage://localhost:12110/fruit@1.0.5#/catalog/apple.pkl")
  }
}

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

(module
  (moduleHeader
    (extendsOrAmendsClause
      (stringConstant)))
  (importClause
    (stringConstant))
  (importClause
    (stringConstant))
  (classProperty
    (identifier)
    (objectBody
      (objectEntry
        (slStringLiteral)
        (objectBody
          (objectElement
            (variableExpr
              (identifier)))
          (objectElement
            (variableExpr
              (identifier)))))
      (objectEntry
        (slStringLiteral)
        (objectBody
          (objectElement
            (importExpr
              (stringConstant)))))
      (objectEntry
        (slStringLiteral)
        (objectBody
          (objectElement
            (readExpr
              (parenthesizedExpr
                (slStringLiteral))))
          (lineComment)
          (objectElement
            (readExpr
              (parenthesizedExpr
                (slStringLiteral))))))))
  (classProperty
    (identifier)
    (objectBody
      (objectEntry
        (slStringLiteral)
        (objectBody
          (objectElement
            (binaryExpr
              (importExpr
                (stringConstant))
              (importExpr
                (stringConstant))))))
      (objectEntry
        (slStringLiteral)
        (objectBody
          (objectElement
            (binaryExpr
              (importExpr
                (stringConstant))
              (importExpr
                (stringConstant))))))
      (objectEntry
        (slStringLiteral)
        (objectBody
          (objectElement
            (binaryExpr
              (propertyCallExpr
                (variableExpr
                  (identifier))
                (identifier))
              (importExpr
                (stringConstant))))))
      (objectEntry
        (slStringLiteral)
        (objectBody
          (objectElement
            (binaryExpr
              (propertyCallExpr
                (variableExpr
                  (identifier))
                (identifier))
              (importExpr
                (stringConstant))))
          (objectElement
            (binaryExpr
              (propertyCallExpr
                (variableExpr
                  (identifier))
                (identifier))
              (importExpr
                (stringConstant)))))))))
