<NME> ElmStdlibImportResolveTest.kt
<BEF> package org.elm.lang.core.resolve


class ElmStdlibImportResolveTest : ElmResolveTestBase() {

    // TODO [kl] re-enable these tests once we can arrange to download Elm Core package
    // and configure a custom [LightProjectDescriptor] that includes Core as standard library.

    // TODO [kl] expand the tests to include additional modules that the Elm compiler includes implicitly.

    fun testDummy() {}

/*

    // Basics Module

    fun testBasicsModuleImported() = stubOnlyResolve(
"""
--@ main.elm
f = Basics.toString 42
           --^ ...Basics.elm
""")

    fun testBasicsExposesAllValues() = stubOnlyResolve(
"""
--@ main.elm
f = toString 42
    --^ ...Basics.elm
""")

    fun testBasicsExposesAllTypes() = stubOnlyResolve(
"""
--@ main.elm
type alias Config = { ordering : Order }
                                 --^ ...Basics.elm
""")

    fun testBasicsExposesAllConstructors() = stubOnlyResolve(
"""
--@ main.elm
f = LT
   --^ ...Basics.elm
""")

// TODO [kl] add a test to verify that operators like `(++)` are imported from Basics



    // List Module

    fun testListModuleImported() = stubOnlyResolve(
"""
--@ main.elm
type alias Model = { ids : List Int }
                           --^ ...List.elm
""")

    fun testListTypeExposed() = stubOnlyResolve(
"""
--@ main.elm
type alias Model = { ids : List Int }
                           --^ ...List.elm
""")

    fun testListConsOpExposed() = stubOnlyResolve(
"""
--@ main.elm
f = 0 :: []
    --^ ...List.elm
""")



    // Maybe Module

    fun testMaybeModuleImported() = stubOnlyResolve(
"""
--@ main.elm
f x = Maybe.withDefault x 42
            --^ ...Maybe.elm
""")

    fun testMaybeTypeExposed() = stubOnlyResolve(
"""
--@ main.elm
type alias Model = { id : Maybe Int }
                          --^ ...Maybe.elm
""")

    fun testMaybeJustExposed() = stubOnlyResolve(
"""
--@ main.elm
f = Just 42
    --^ ...Maybe.elm
""")

    fun testMaybeNothingExposed() = stubOnlyResolve(
"""
--@ main.elm
f = Nothing
    --^ ...Maybe.elm
""")
*/


}


    fun `test Platform Sub module imported using Sub alias (module ref)`() = stubOnlyResolve(
            """
--@ main.elm
f = Sub.none
    --^...Platform/Sub.elm
""")


    fun `test Platform Sub module imported using Sub alias (value ref)`() = stubOnlyResolve(
            """
--@ main.elm
f = Sub.none
        --^...Platform/Sub.elm
""")


    fun `test Platform Sub module exposes Sub type`() = stubOnlyResolve(
            """
--@ main.elm
type alias Foo = Sub
                 --^...Platform/Sub.elm
""")


    fun `test Platform Sub module doesn't expose anything else`() = stubOnlyResolve(
            """
--@ main.elm
f = batch
    --^unresolved
""")


}
<MSG> Enable integration tests that depend on elm/core stdlib

<DFF> @@ -1,106 +1,346 @@
 package org.elm.lang.core.resolve
 
 
+/**
+ * Test resolving values and types provided by the elm/core package.
+ *
+ * Special emphasis is put on verifying that the implicit, default imports provided by the Elm compiler
+ * are handled correctly. For the full list of default imports, see:
+ * https://package.elm-lang.org/packages/elm/core/latest/
+ */
 class ElmStdlibImportResolveTest : ElmResolveTestBase() {
 
-    // TODO [kl] re-enable these tests once we can arrange to download Elm Core package
-    // and configure a custom [LightProjectDescriptor] that includes Core as standard library.
+    override fun getProjectDescriptor() =
+            ElmWithStdlibDescriptor
 
-    // TODO [kl] expand the tests to include additional modules that the Elm compiler includes implicitly.
 
-    fun testDummy() {}
+    // BASICS MODULE
 
-/*
 
-    // Basics Module
-
-    fun testBasicsModuleImported() = stubOnlyResolve(
-"""
+    fun `test Basics module imported`() = stubOnlyResolve(
+            """
 --@ main.elm
-f = Basics.toString 42
-           --^ ...Basics.elm
+f = Basics.toFloat 42
+           --^...Basics.elm
 """)
 
-    fun testBasicsExposesAllValues() = stubOnlyResolve(
-"""
+
+    fun `test Basics exposes all values`() = stubOnlyResolve(
+            """
 --@ main.elm
-f = toString 42
-    --^ ...Basics.elm
+f = toFloat 42
+    --^...Basics.elm
 """)
 
-    fun testBasicsExposesAllTypes() = stubOnlyResolve(
-"""
+
+    fun `test Basics exposes all types`() = stubOnlyResolve(
+            """
 --@ main.elm
 type alias Config = { ordering : Order }
-                                 --^ ...Basics.elm
+                                 --^...Basics.elm
 """)
 
-    fun testBasicsExposesAllConstructors() = stubOnlyResolve(
-"""
+
+    fun `test Basics exposes all constructors`() = stubOnlyResolve(
+            """
 --@ main.elm
 f = LT
-   --^ ...Basics.elm
+   --^...Basics.elm
 """)
 
-// TODO [kl] add a test to verify that operators like `(++)` are imported from Basics
+
+    fun `test Basics exposes binary operators`() = stubOnlyResolve(
+            """
+--@ main.elm
+f = 2 + 2
+    --^...Basics.elm
+""")
 
 
+    // LIST MODULE
 
-    // List Module
 
-    fun testListModuleImported() = stubOnlyResolve(
-"""
+    fun `test List module imported`() = stubOnlyResolve(
+            """
 --@ main.elm
-type alias Model = { ids : List Int }
-                           --^ ...List.elm
+n = List.length [0, 1, 2]
+    --^...List.elm
 """)
 
-    fun testListTypeExposed() = stubOnlyResolve(
-"""
+
+    fun `test List cons op exposed`() = stubOnlyResolve(
+            """
 --@ main.elm
-type alias Model = { ids : List Int }
-                           --^ ...List.elm
+f = 0 :: []
+    --^...List.elm
 """)
 
-    fun testListConsOpExposed() = stubOnlyResolve(
-"""
+
+    fun `test List doesn't expose anything else`() = stubOnlyResolve(
+            """
 --@ main.elm
-f = 0 :: []
-    --^ ...List.elm
+f = foldl (+) [0,1,2]
+    --^unresolved
 """)
 
 
+    // MAYBE MODULE
 
-    // Maybe Module
 
-    fun testMaybeModuleImported() = stubOnlyResolve(
-"""
+    fun `test Maybe module imported`() = stubOnlyResolve(
+            """
 --@ main.elm
 f x = Maybe.withDefault x 42
-            --^ ...Maybe.elm
+       --^...Maybe.elm
 """)
 
-    fun testMaybeTypeExposed() = stubOnlyResolve(
-"""
+
+    fun `test Maybe type exposed`() = stubOnlyResolve(
+            """
 --@ main.elm
-type alias Model = { id : Maybe Int }
-                          --^ ...Maybe.elm
+type alias Foo = Maybe Int
+                 --^...Maybe.elm
 """)
 
-    fun testMaybeJustExposed() = stubOnlyResolve(
-"""
+
+    fun `test Maybe Just exposed`() = stubOnlyResolve(
+            """
 --@ main.elm
 f = Just 42
-    --^ ...Maybe.elm
+    --^...Maybe.elm
 """)
 
-    fun testMaybeNothingExposed() = stubOnlyResolve(
-"""
+
+    fun `test Maybe Nothing exposed`() = stubOnlyResolve(
+            """
 --@ main.elm
 f = Nothing
-    --^ ...Maybe.elm
+    --^...Maybe.elm
+""")
+
+
+    fun `test Maybe doesn't expose anything else`() = stubOnlyResolve(
+            """
+--@ main.elm
+f = withDefault
+    --^unresolved
+""")
+
+
+    // RESULT MODULE
+
+
+    fun `test Result module imported`() = stubOnlyResolve(
+            """
+--@ main.elm
+f x = Result.withDefault x 42
+       --^...Result.elm
+""")
+
+
+    fun `test Result type exposed`() = stubOnlyResolve(
+            """
+--@ main.elm
+type alias Foo = Result String Int
+                 --^...Result.elm
+""")
+
+
+    fun `test Result Ok exposed`() = stubOnlyResolve(
+            """
+--@ main.elm
+f = Ok 42
+   --^...Result.elm
+""")
+
+
+    fun `test Result Err exposed`() = stubOnlyResolve(
+            """
+--@ main.elm
+f = Err "uh oh"
+    --^...Result.elm
+""")
+
+
+    fun `test Result module doesn't expose anything else`() = stubOnlyResolve(
+            """
+--@ main.elm
+f x = toMaybe x 42
+      --^unresolved
+""")
+
+
+    // STRING MODULE
+
+
+    fun `test String module imported`() = stubOnlyResolve(
+            """
+--@ main.elm
+f x = String.length x
+       --^...String.elm
+""")
+
+
+    fun `test String type exposed`() = stubOnlyResolve(
+            """
+--@ main.elm
+type alias Foo = String
+                 --^...String.elm
+""")
+
+
+    fun `test String module doesn't expose anything else`() = stubOnlyResolve(
+            """
+--@ main.elm
+f = length "hello"
+      --^unresolved
+""")
+
+
+    // CHAR MODULE
+
+
+    fun `test Char module imported`() = stubOnlyResolve(
+            """
+--@ main.elm
+f x = Char.isUpper x
+      --^...Char.elm
+""")
+
+
+    fun `test Char type exposed`() = stubOnlyResolve(
+            """
+--@ main.elm
+type alias Foo = Char
+                 --^...Char.elm
+""")
+
+
+    fun `test Char module doesn't expose anything else`() = stubOnlyResolve(
+            """
+--@ main.elm
+f = isUpper 'A'
+      --^unresolved
+""")
+
+
+    // TUPLE MODULE
+
+
+    fun `test Tuple module imported`() = stubOnlyResolve(
+            """
+--@ main.elm
+f = Tuple.first (0, 0)
+      --^...Tuple.elm
+""")
+
+
+    fun `test Tuple module doesn't expose anything else`() = stubOnlyResolve(
+            """
+--@ main.elm
+f = pair 0 0
+    --^unresolved
+""")
+
+
+    // DEBUG MODULE
+
+
+    fun `test Debug module imported`() = stubOnlyResolve(
+            """
+--@ main.elm
+f = Debug.toString
+    --^...Debug.elm
+""")
+
+
+    fun `test Debug module doesn't expose anything else`() = stubOnlyResolve(
+            """
+--@ main.elm
+f = toString
+    --^unresolved
+""")
+
+
+    // PLATFORM MODULE
+
+
+    fun `test Platform module imported`() = stubOnlyResolve(
+            """
+--@ main.elm
+f = Platform.worker
+    --^...Platform.elm
+""")
+
+
+    fun `test Platform module exposes Program type`() = stubOnlyResolve(
+            """
+--@ main.elm
+type alias Foo = Program
+                 --^...Platform.elm
+""")
+
+
+    fun `test Platform module doesn't expose anything else`() = stubOnlyResolve(
+            """
+--@ main.elm
+f = worker
+    --^unresolved
+""")
+
+
+    // PLATFORM.CMD MODULE
+
+
+    fun `test Platform Cmd module imported using Cmd alias`() = stubOnlyResolve(
+            """
+--@ main.elm
+f = Cmd.none
+    --^...Platform/Cmd.elm
+""")
+
+
+    fun `test Platform Cmd module exposes Cmd type`() = stubOnlyResolve(
+            """
+--@ main.elm
+type alias Foo = Cmd
+                 --^...Platform/Cmd.elm
+""")
+
+
+    fun `test Platform Cmd module doesn't expose anything else`() = stubOnlyResolve(
+            """
+--@ main.elm
+f = batch
+    --^unresolved
+""")
+
+
+    // PLATFORM.SUB MODULE
+
+
+    fun `test Platform Sub module imported using Sub alias`() = stubOnlyResolve(
+            """
+--@ main.elm
+f = Sub.none
+    --^...Platform/Sub.elm
+""")
+
+
+    fun `test Platform Sub module exposes Sub type`() = stubOnlyResolve(
+            """
+--@ main.elm
+type alias Foo = Sub
+                 --^...Platform/Sub.elm
+""")
+
+
+    fun `test Platform Sub module doesn't expose anything else`() = stubOnlyResolve(
+            """
+--@ main.elm
+f = batch
+    --^unresolved
 """)
-*/
 
 
 }
\ No newline at end of file

Enable integration tests that depend on elm/core stdlib