I’m hoping to work on a fix for this elm/core
bug.
Seems like the right place to start is to run the existing test suite. Running elm-test
produced some errors, though.
The first couple were easy to fix; I made these changes on top of the current tip of its master branch (22b2d7a2
):
diff --git a/elm.json b/elm.json
index 745d790..1d9f9cc 100644
--- a/elm.json
+++ b/elm.json
@@ -35,5 +35,7 @@
},
"elm-version": "0.19.0 <= v < 0.20.0",
"dependencies": {},
- "test-dependencies": {}
-}
\ No newline at end of file
+ "test-dependencies": {
+ "elm-explorations/test": "1.2.1 <= v < 2.0.0"
+ }
+}
diff --git a/tests/Test/List.elm b/tests/Test/List.elm
index ed26f0f..d5fd9d2 100644
--- a/tests/Test/List.elm
+++ b/tests/Test/List.elm
@@ -3,7 +3,7 @@ module Test.List exposing (tests)
import Test exposing (..)
import Expect
import Basics exposing (..)
-import Maybe exposing (Maybe(Nothing, Just))
+import Maybe exposing (Maybe(..))
import List exposing (..)
That gets me to this error, which has me stumped:
$ rm -rf .elm && ELM_HOME=$(pwd)/.elm ./node_modules/elm-test/bin/elm-test
-- AMBIGUOUS IMPORT ------------- /home/matt/git/elm/core/tests/Test/Bitwise.elm
The Test.Bitwise module has an ambiguous import:
import Bitwise
I found multiple module with that name though:
/home/matt/git/elm/core/src/Bitwise.elm
exposed by elm/core 1.0.0
Which is the right one? Try renaming your modules to have unique names.
Compilation failed while attempting to build /home/matt/git/elm/core/tests/Main.elm /home/matt/git/elm/core/tests/Test/Array.elm /home/matt/git/elm/core/tests/Test/Basics.elm /home/matt/git/elm/core/tests/Test/Bitwise.elm /home/matt/git/elm/core/tests/Test/Char.elm /home/matt/git/elm/core/tests/Test/CodeGen.elm /home/matt/git/elm/core/tests/Test/Dict.elm /home/matt/git/elm/core/tests/Test/Equality.elm /home/matt/git/elm/core/tests/Test/List.elm /home/matt/git/elm/core/tests/Test/Maybe.elm /home/matt/git/elm/core/tests/Test/Result.elm /home/matt/git/elm/core/tests/Test/Set.elm /home/matt/git/elm/core/tests/Test/String.elm /home/matt/git/elm/core/tests/Test/Tuple.elm
There is a tests/run-tests.sh
script, but clearly it hasn’t been updated for 0.19 yet (it still references elm-make
etc. and git history says it was last touched in 2016).
That run-tests.sh
script seems like it’s trying to fake out the elm/core
directory inside the old elm-stuff/
directory. So I tried something similar based on my understanding of how the analogous mechanism works in 0.19:
$ rm -rf .elm/0.19.0/package/elm/core/1.0.0 && ln -s $(pwd) .elm/0.19.0/package/elm/core/1.0.0
$ ELM_HOME=$(pwd)/.elm ./node_modules/elm-test/bin/elm-test
elm: getCurrentDirectory:getWorkingDirectory: does not exist (Current working directory no longer exists)
elm: getCurrentDirectory:getWorkingDirectory: does not exist (Current working directory no longer exists)
elm: getCurrentDirectory:getWorkingDirectory: does not exist (Current working directory no longer exists)
elm: getCurrentDirectory:getWorkingDirectory: does not exist (Current working directory no longer exists)
elm: thread blocked indefinitely in an MVar operation
Compilation failed while attempting to build /home/matt/git/elm/core/tests/Main.elm /home/matt/git/elm/core/tests/Test/Array.elm /home/matt/git/elm/core/tests/Test/Basics.elm /home/matt/git/elm/core/tests/Test/Bitwise.elm /home/matt/git/elm/core/tests/Test/Char.elm /home/matt/git/elm/core/tests/Test/CodeGen.elm /home/matt/git/elm/core/tests/Test/Dict.elm /home/matt/git/elm/core/tests/Test/Equality.elm /home/matt/git/elm/core/tests/Test/List.elm /home/matt/git/elm/core/tests/Test/Maybe.elm /home/matt/git/elm/core/tests/Test/Result.elm /home/matt/git/elm/core/tests/Test/Set.elm /home/matt/git/elm/core/tests/Test/String.elm /home/matt/git/elm/core/tests/Test/Tuple.elm
So, is there a way to run these tests?