Merge pull request #126 from tgecho/elm-0.18

Switch to an npm managed setup + upgrade to Elm 0.18
This commit is contained in:
Erik Simmler 2016-12-18 08:40:11 -05:00 committed by GitHub
commit 618838ab00
191 changed files with 1792 additions and 332 deletions

1
.gitignore vendored
View file

@ -6,3 +6,4 @@ bin/elm-format
elm-stuff
CHECKLIST
build.js
node_modules

View file

@ -7,8 +7,7 @@ sudo: false
install:
- nvm install 6
- nvm use 6
- npm install -g elm@0.17.1 elm-test@0.17.3
- elm package install -y
- npm install
- bin/install-elm-format linux
- export PATH=$PATH:$PWD/bin
@ -19,4 +18,5 @@ script:
cache:
directories:
- elm-stuff
- node_modules
- elm-stuff

View file

@ -1,5 +1,18 @@
## Getting Started
## Elm Installation
To get started, please see docs on exercism.io:
Refer to the [exercism help page][http://exercism.io/languages/elm] for Elm installation and learning
resources.
http://exercism.io/languages/elm
## Writing the Code
The first time you start an exercise, you'll need to ensure you have the appropriate dependancies installed.
```bash
$ npm install
```
Execute the tests with:
```bash
$ npm test
```

View file

@ -12,7 +12,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
elm-format --yes --validate exercises/**/*{.example,Tests.elm}
elm-format --yes --validate exercises/**/{*.example.elm,Tests.elm}
if [ $? -ne 0 ]; then
echo "*******************************************************************"
@ -33,30 +33,30 @@ fi
declare -i TEST_RESULT=0
FAILED_EXERCISES=''
for example_file in exercises/**/*.example
for example_file in exercises/**/*.example.elm
do
exercise_dir=$(dirname $example_file)
exercise=$(basename $example_file .example)
mv "$exercise_dir/$exercise.elm" "$exercise_dir/$exercise.impl"
mv "$exercise_dir/$exercise.example" "$exercise_dir/$exercise.elm"
exercise_name=$(basename $example_file .example.elm)
mv "$exercise_dir/$exercise_name.elm" "$exercise_dir/$exercise_name.impl"
mv "$exercise_dir/$exercise_name.example.elm" "$exercise_dir/$exercise_name.elm"
echo '-------------------------------------------------------'
echo "Testing $exercise"
echo "Testing $exercise_name"
# prevent elm-test from installing dependencies
mv $exercise_dir/elm-package.json $exercise_dir/elm-package.json.disabled
elm-test $exercise_dir/*Tests.elm
npm test -- $exercise_dir/Tests.elm
# capture result from last command (elm-test)
if [ $? -ne 0 ]; then
TEST_RESULT=1
FAILED_EXERCISES+="$exercise\n"
FAILED_EXERCISES+="$exercise_name\n"
fi
# be kind, rewind
mv $exercise_dir/elm-package.json.disabled $exercise_dir/elm-package.json
mv "$exercise_dir/$exercise.elm" "$exercise_dir/$exercise.example"
mv "$exercise_dir/$exercise.impl" "$exercise_dir/$exercise.elm"
mv "$exercise_dir/$exercise_name.elm" "$exercise_dir/$exercise_name.example.elm"
mv "$exercise_dir/$exercise_name.impl" "$exercise_dir/$exercise_name.elm"
done
if [ $TEST_RESULT -ne 0 ]; then

View file

@ -12,7 +12,7 @@ case $(uname) in
echo "linux";;
esac)
URL=https://github.com/avh4/elm-format/releases/download/0.4.0-alpha/elm-format-0.17-0.4.0-alpha-$OS-x64.tgz
URL=https://github.com/avh4/elm-format/releases/download/0.5.2-alpha/elm-format-0.18-0.5.2-alpha-$OS-x64.tgz
curl -L $URL | tar -xvzO > bin/elm-format

View file

@ -2,8 +2,8 @@
The simplest way to install Elm is via Node.js/NPM.
If you don't already have Node.js installed on your computer, you can download it from [the official site](https://nodejs.org/). Once you have Node.js up and running, follow these steps to install the Elm platform and `elm-test`.
If you don't already have Node.js installed on your computer, you can download it from [the official site](https://nodejs.org/). Once you have Node.js up and running, run this command from inside an exercise directory to install the Elm platform and `elm-test`.
```bash
$ npm install --global elm@0.17.1 elm-test@0.17.3
$ npm install
```

View file

@ -2,15 +2,15 @@ The Elm exercise test suites may be run from the exercise directory.
```bash
$ cd exercism/project/directory/elm/hello-world
$ elm-test *Tests.elm
$ npm install # only required the first time you start an exercise
$ npm test
```
Replace `*` with the name of the exercise you're on, e.g. HelloWorld for the Hello World exercise.
## Hints and tips
### Coding the exercise
The README.md for each exercise gives a general description but the Elm test program will be very specific. Open the test program and give it a quick look - if it seems like cheating, do it anyway. Look for helpful comments, test data, and just the names of the test functions. Try running the test command before you have written anything and see if the error messages give you an idea of where to start.
The README.md for each exercise gives a general description, but the Elm test program will be very specific. Open the test program and give it a quick look - if it seems like cheating, do it anyway. Look for helpful comments, test data, and just the names of the test functions. Try running the test command before you have written anything and see if the error messages give you an idea of where to start.
Your first goal it to get something to compile, even though it fails tests. For this, you should "stub" functions. That means leave the body empty, except for whatever it must return. Write something like `myFunc param = 0` or whatever it takes just to get it to compile. Sometimes to figure out function types you will have to go back to the test program and read in more detail. Once you have figured out all the required function signatures, the test program will complain that `0` is the wrong answer. Now start filling in function bodies.

View file

@ -1,5 +1,5 @@
{
"version": "2.0.0",
"version": "3.0.0",
"summary": "Exercism problems in Elm.",
"repository": "https://github.com/exercism/xelm.git",
"license": "BSD3",
@ -38,9 +38,9 @@
],
"exposed-modules": [],
"dependencies": {
"elm-lang/core": "4.0.0 <= v < 5.0.0",
"elm-community/elm-test": "2.0.0 <= v < 3.0.0",
"rtfeldman/node-test-runner": "2.0.0 <= v < 3.0.0"
"elm-lang/core": "5.0.0 <= v < 6.0.0",
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
"elm-version": "0.18.0 <= v < 0.19.0"
}

View file

@ -1,6 +1,6 @@
port module Main exposing (..)
import Test.Runner.Node exposing (run)
import Test.Runner.Node exposing (run, TestProgram)
import Json.Encode exposing (Value)
import Test exposing (..)
import Expect
@ -31,7 +31,7 @@ tests =
]
main : Program Value
main : TestProgram
main =
run emit tests

View file

@ -8,9 +8,9 @@
],
"exposed-modules": [],
"dependencies": {
"elm-lang/core": "4.0.0 <= v < 5.0.0",
"elm-community/elm-test": "2.0.0 <= v < 3.0.0",
"rtfeldman/node-test-runner": "2.0.0 <= v < 3.0.0"
"elm-lang/core": "5.0.0 <= v < 6.0.0",
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
"elm-version": "0.18.0 <= v < 0.19.0"
}

View file

@ -0,0 +1,13 @@
{
"description": "Excercism/Elm",
"repository": "https://github.com/exercism/xelm.git",
"license": "MIT",
"scripts": {
"postinstall": "elm-package install -y",
"test": "elm-test Tests.elm"
},
"dependencies": {
"elm": "^0.18.0",
"elm-test": "^0.18.0"
}
}

View file

@ -1 +0,0 @@
ECHO We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm

View file

@ -1,2 +0,0 @@
#!/usr/bin/env bash
echo "We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm"

View file

@ -12,9 +12,9 @@ isAllergicTo name score =
toList : Int -> List String
toList score =
allergies
|> List.indexedMap (\i n -> ( Bitwise.shiftLeft 1 i, n ))
|> List.indexedMap (\i n -> ( Bitwise.shiftLeftBy i 1, n ))
|> List.filter (\( s, n ) -> Bitwise.and s score > 0)
|> List.map snd
|> List.map Tuple.second
allergies : List String

View file

@ -1,6 +1,6 @@
port module Main exposing (..)
import Test.Runner.Node exposing (run)
import Test.Runner.Node exposing (run, TestProgram)
import Json.Encode exposing (Value)
import Test exposing (..)
import Expect
@ -50,7 +50,7 @@ tests =
]
main : Program Value
main : TestProgram
main =
run emit tests

View file

@ -8,9 +8,9 @@
],
"exposed-modules": [],
"dependencies": {
"elm-lang/core": "4.0.0 <= v < 5.0.0",
"elm-community/elm-test": "2.0.0 <= v < 3.0.0",
"rtfeldman/node-test-runner": "2.0.0 <= v < 3.0.0"
"elm-lang/core": "5.0.0 <= v < 6.0.0",
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
"elm-version": "0.18.0 <= v < 0.19.0"
}

View file

@ -0,0 +1,13 @@
{
"description": "Excercism/Elm",
"repository": "https://github.com/exercism/xelm.git",
"license": "MIT",
"scripts": {
"postinstall": "elm-package install -y",
"test": "elm-test Tests.elm"
},
"dependencies": {
"elm": "^0.18.0",
"elm-test": "^0.18.0"
}
}

View file

@ -1 +0,0 @@
ECHO We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm

View file

@ -1,2 +0,0 @@
#!/usr/bin/env bash
echo "We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm"

View file

@ -1,6 +1,6 @@
port module Main exposing (..)
import Test.Runner.Node exposing (run)
import Test.Runner.Node exposing (run, TestProgram)
import Json.Encode exposing (Value)
import Test exposing (..)
import Expect
@ -93,7 +93,7 @@ tests =
]
main : Program Value
main : TestProgram
main =
run emit tests

View file

@ -8,9 +8,9 @@
],
"exposed-modules": [],
"dependencies": {
"elm-lang/core": "4.0.0 <= v < 5.0.0",
"elm-community/elm-test": "2.0.0 <= v < 3.0.0",
"rtfeldman/node-test-runner": "2.0.0 <= v < 3.0.0"
"elm-lang/core": "5.0.0 <= v < 6.0.0",
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
"elm-version": "0.18.0 <= v < 0.19.0"
}

View file

@ -0,0 +1,13 @@
{
"description": "Excercism/Elm",
"repository": "https://github.com/exercism/xelm.git",
"license": "MIT",
"scripts": {
"postinstall": "elm-package install -y",
"test": "elm-test Tests.elm"
},
"dependencies": {
"elm": "^0.18.0",
"elm-test": "^0.18.0"
}
}

View file

@ -1 +0,0 @@
ECHO We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm

View file

@ -1,2 +0,0 @@
#!/usr/bin/env bash
echo "We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm"

View file

@ -1,6 +1,6 @@
port module Main exposing (..)
import Test.Runner.Node exposing (run)
import Test.Runner.Node exposing (run, TestProgram)
import Json.Encode exposing (Value)
import Test exposing (..)
import Expect
@ -37,7 +37,7 @@ tests =
]
main : Program Value
main : TestProgram
main =
run emit tests

View file

@ -8,9 +8,9 @@
],
"exposed-modules": [],
"dependencies": {
"elm-lang/core": "4.0.0 <= v < 5.0.0",
"elm-community/elm-test": "2.0.0 <= v < 3.0.0",
"rtfeldman/node-test-runner": "2.0.0 <= v < 3.0.0"
"elm-lang/core": "5.0.0 <= v < 6.0.0",
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
"elm-version": "0.18.0 <= v < 0.19.0"
}

View file

@ -0,0 +1,13 @@
{
"description": "Excercism/Elm",
"repository": "https://github.com/exercism/xelm.git",
"license": "MIT",
"scripts": {
"postinstall": "elm-package install -y",
"test": "elm-test Tests.elm"
},
"dependencies": {
"elm": "^0.18.0",
"elm-test": "^0.18.0"
}
}

View file

@ -1 +0,0 @@
ECHO We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm

View file

@ -1,2 +0,0 @@
#!/usr/bin/env bash
echo "We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm"

View file

@ -1,6 +1,6 @@
port module Main exposing (..)
import Test.Runner.Node exposing (run)
import Test.Runner.Node exposing (run, TestProgram)
import Json.Encode exposing (Value)
import Test exposing (..)
import Expect
@ -137,7 +137,7 @@ listOfCharacters length characterList =
gibberish : Int -> Random.Generator Char -> String
gibberish length characterList =
fst (Random.step (Random.map String.fromList (listOfCharacters length characterList)) (Random.initialSeed 424242))
Tuple.first (Random.step (Random.map String.fromList (listOfCharacters length characterList)) (Random.initialSeed 424242))
uppercaseGibberish : Int -> String
@ -150,7 +150,7 @@ gibberishQuestion length =
(gibberish length anyCharacter) ++ "?"
main : Program Value
main : TestProgram
main =
run emit tests

View file

@ -8,9 +8,9 @@
],
"exposed-modules": [],
"dependencies": {
"elm-lang/core": "4.0.0 <= v < 5.0.0",
"elm-community/elm-test": "2.0.0 <= v < 3.0.0",
"rtfeldman/node-test-runner": "2.0.0 <= v < 3.0.0"
"elm-lang/core": "5.0.0 <= v < 6.0.0",
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
"elm-version": "0.18.0 <= v < 0.19.0"
}

View file

@ -0,0 +1,13 @@
{
"description": "Excercism/Elm",
"repository": "https://github.com/exercism/xelm.git",
"license": "MIT",
"scripts": {
"postinstall": "elm-package install -y",
"test": "elm-test Tests.elm"
},
"dependencies": {
"elm": "^0.18.0",
"elm-test": "^0.18.0"
}
}

View file

@ -1 +0,0 @@
ECHO We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm

View file

@ -1,2 +0,0 @@
#!/usr/bin/env bash
echo "We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm"

View file

@ -12,7 +12,7 @@ squareOfSum n =
sumOfSquares : Int -> Int
sumOfSquares n =
List.sum (List.map (\m -> m * m) [0..n])
List.sum (List.map (\m -> m * m) (List.range 0 n))
difference : Int -> Int

View file

@ -1,6 +1,6 @@
port module Main exposing (..)
import Test.Runner.Node exposing (run)
import Test.Runner.Node exposing (run, TestProgram)
import Json.Encode exposing (Value)
import Test exposing (..)
import Expect
@ -39,7 +39,7 @@ tests =
]
main : Program Value
main : TestProgram
main =
run emit tests

View file

@ -8,9 +8,9 @@
],
"exposed-modules": [],
"dependencies": {
"elm-lang/core": "4.0.0 <= v < 5.0.0",
"elm-community/elm-test": "2.0.0 <= v < 3.0.0",
"rtfeldman/node-test-runner": "2.0.0 <= v < 3.0.0"
"elm-lang/core": "5.0.0 <= v < 6.0.0",
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
"elm-version": "0.18.0 <= v < 0.19.0"
}

View file

@ -0,0 +1,13 @@
{
"description": "Excercism/Elm",
"repository": "https://github.com/exercism/xelm.git",
"license": "MIT",
"scripts": {
"postinstall": "elm-package install -y",
"test": "elm-test Tests.elm"
},
"dependencies": {
"elm": "^0.18.0",
"elm-test": "^0.18.0"
}
}

View file

@ -1 +0,0 @@
ECHO We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm

View file

@ -1,2 +0,0 @@
#!/usr/bin/env bash
echo "We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm"

View file

@ -1,6 +1,6 @@
port module Main exposing (..)
import Test.Runner.Node exposing (run)
import Test.Runner.Node exposing (run, TestProgram)
import Json.Encode exposing (Value)
import Test exposing (..)
import Expect
@ -41,7 +41,7 @@ date input =
Debug.crash reason
main : Program Value
main : TestProgram
main =
run emit tests

View file

@ -8,9 +8,9 @@
],
"exposed-modules": [],
"dependencies": {
"elm-lang/core": "4.0.0 <= v < 5.0.0",
"elm-community/elm-test": "2.0.0 <= v < 3.0.0",
"rtfeldman/node-test-runner": "2.0.0 <= v < 3.0.0"
"elm-lang/core": "5.0.0 <= v < 6.0.0",
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
"elm-version": "0.18.0 <= v < 0.19.0"
}

View file

@ -0,0 +1,13 @@
{
"description": "Excercism/Elm",
"repository": "https://github.com/exercism/xelm.git",
"license": "MIT",
"scripts": {
"postinstall": "elm-package install -y",
"test": "elm-test Tests.elm"
},
"dependencies": {
"elm": "^0.18.0",
"elm-test": "^0.18.0"
}
}

View file

@ -1 +0,0 @@
ECHO We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm

View file

@ -1,2 +0,0 @@
#!/usr/bin/env bash
echo "We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm"

View file

@ -37,4 +37,4 @@ studentsInGrade grade school =
allStudents : School -> List ( Grade, List Student )
allStudents school =
Dict.toList school |> List.sortBy fst
Dict.toList school |> List.sortBy Tuple.first

View file

@ -1,6 +1,6 @@
port module Main exposing (..)
import Test.Runner.Node exposing (run)
import Test.Runner.Node exposing (run, TestProgram)
import Json.Encode exposing (Value)
import Test exposing (..)
import Expect
@ -61,7 +61,7 @@ tests =
]
main : Program Value
main : TestProgram
main =
run emit tests

View file

@ -8,9 +8,9 @@
],
"exposed-modules": [],
"dependencies": {
"elm-lang/core": "4.0.0 <= v < 5.0.0",
"elm-community/elm-test": "2.0.0 <= v < 3.0.0",
"rtfeldman/node-test-runner": "2.0.0 <= v < 3.0.0"
"elm-lang/core": "5.0.0 <= v < 6.0.0",
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
"elm-version": "0.18.0 <= v < 0.19.0"
}

View file

@ -0,0 +1,13 @@
{
"description": "Excercism/Elm",
"repository": "https://github.com/exercism/xelm.git",
"license": "MIT",
"scripts": {
"postinstall": "elm-package install -y",
"test": "elm-test Tests.elm"
},
"dependencies": {
"elm": "^0.18.0",
"elm-test": "^0.18.0"
}
}

View file

@ -1 +0,0 @@
ECHO We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm

View file

@ -1,2 +0,0 @@
#!/usr/bin/env bash
echo "We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm"

View file

@ -1,6 +1,6 @@
port module Main exposing (..)
import Test.Runner.Node exposing (run)
import Test.Runner.Node exposing (run, TestProgram)
import Json.Encode exposing (Value)
import Test exposing (..)
import Expect
@ -41,7 +41,7 @@ tests =
]
main : Program Value
main : TestProgram
main =
run emit tests

View file

@ -8,9 +8,9 @@
],
"exposed-modules": [],
"dependencies": {
"elm-lang/core": "4.0.0 <= v < 5.0.0",
"elm-community/elm-test": "2.0.0 <= v < 3.0.0",
"rtfeldman/node-test-runner": "2.0.0 <= v < 3.0.0"
"elm-lang/core": "5.0.0 <= v < 6.0.0",
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
"elm-version": "0.18.0 <= v < 0.19.0"
}

View file

@ -0,0 +1,13 @@
{
"description": "Excercism/Elm",
"repository": "https://github.com/exercism/xelm.git",
"license": "MIT",
"scripts": {
"postinstall": "elm-package install -y",
"test": "elm-test Tests.elm"
},
"dependencies": {
"elm": "^0.18.0",
"elm-test": "^0.18.0"
}
}

View file

@ -1 +0,0 @@
ECHO We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm

View file

@ -1,2 +0,0 @@
#!/usr/bin/env bash
echo "We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm"

View file

@ -1,9 +1,9 @@
{-
This is a "stub" file. It's a little start on your solution. It's not a
complete solution though; you have to write some code.
This is a "stub" file. It's a little start on your solution. It's not a
complete solution though; you have to write some code.
The module name is expected by the test program and must match the name of this
file. It has to stay just the way it is.
The module name is expected by the test program and must match the name of this
file. It has to stay just the way it is.
-}
@ -14,12 +14,12 @@ module HelloWorld exposing (..)
helloWorld : Maybe String -> String
helloWorld name =
"replace with your code!"
"replace with your code!"
{-
When you have a working solution, REMOVE ALL THE STOCK COMMENTS.
They're here to help you get started but they only clutter a finished solution.
If you leave them in, nitpickers will protest!
When you have a working solution, REMOVE ALL THE STOCK COMMENTS.
They're here to help you get started but they only clutter a finished solution.
If you leave them in, nitpickers will protest!
-}

View file

@ -1,6 +1,6 @@
port module Main exposing (..)
import Test.Runner.Node exposing (run)
import Test.Runner.Node exposing (run, TestProgram)
import Json.Encode exposing (Value)
import Test exposing (..)
import Expect
@ -22,7 +22,7 @@ tests =
]
main : Program Value
main : TestProgram
main =
run emit tests

View file

@ -8,9 +8,9 @@
],
"exposed-modules": [],
"dependencies": {
"elm-lang/core": "4.0.0 <= v < 5.0.0",
"elm-community/elm-test": "2.0.0 <= v < 3.0.0",
"rtfeldman/node-test-runner": "2.0.0 <= v < 3.0.0"
"elm-lang/core": "5.0.0 <= v < 6.0.0",
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
"elm-version": "0.18.0 <= v < 0.19.0"
}

View file

@ -0,0 +1,13 @@
{
"description": "Excercism/Elm",
"repository": "https://github.com/exercism/xelm.git",
"license": "MIT",
"scripts": {
"postinstall": "elm-package install -y",
"test": "elm-test Tests.elm"
},
"dependencies": {
"elm": "^0.18.0",
"elm-test": "^0.18.0"
}
}

View file

@ -1 +0,0 @@
ECHO We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm

View file

@ -1,2 +0,0 @@
#!/usr/bin/env bash
echo "We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm"

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
port module Main exposing (..)
import Test.Runner.Node exposing (run)
import Test.Runner.Node exposing (run, TestProgram)
import Json.Encode exposing (Value)
import Test exposing (..)
import Expect
@ -47,7 +47,7 @@ tests =
]
main : Program Value
main : TestProgram
main =
run emit tests

View file

@ -8,9 +8,9 @@
],
"exposed-modules": [],
"dependencies": {
"elm-lang/core": "4.0.0 <= v < 5.0.0",
"elm-community/elm-test": "2.0.0 <= v < 3.0.0",
"rtfeldman/node-test-runner": "2.0.0 <= v < 3.0.0"
"elm-lang/core": "5.0.0 <= v < 6.0.0",
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
"elm-version": "0.18.0 <= v < 0.19.0"
}

View file

@ -0,0 +1,13 @@
{
"description": "Excercism/Elm",
"repository": "https://github.com/exercism/xelm.git",
"license": "MIT",
"scripts": {
"postinstall": "elm-package install -y",
"test": "elm-test Tests.elm"
},
"dependencies": {
"elm": "^0.18.0",
"elm-test": "^0.18.0"
}
}

View file

@ -1 +0,0 @@
ECHO We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm

View file

@ -1,2 +0,0 @@
#!/usr/bin/env bash
echo "We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm"

View file

@ -1,6 +1,6 @@
port module Main exposing (..)
import Test.Runner.Node exposing (run)
import Test.Runner.Node exposing (run, TestProgram)
import Json.Encode exposing (Value)
import Test exposing (..)
import Expect
@ -27,7 +27,7 @@ tests =
]
main : Program Value
main : TestProgram
main =
run emit tests

View file

@ -8,9 +8,9 @@
],
"exposed-modules": [],
"dependencies": {
"elm-lang/core": "4.0.0 <= v < 5.0.0",
"elm-community/elm-test": "2.0.0 <= v < 3.0.0",
"rtfeldman/node-test-runner": "2.0.0 <= v < 3.0.0"
"elm-lang/core": "5.0.0 <= v < 6.0.0",
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
"elm-version": "0.18.0 <= v < 0.19.0"
}

View file

@ -0,0 +1,13 @@
{
"description": "Excercism/Elm",
"repository": "https://github.com/exercism/xelm.git",
"license": "MIT",
"scripts": {
"postinstall": "elm-package install -y",
"test": "elm-test Tests.elm"
},
"dependencies": {
"elm": "^0.18.0",
"elm-test": "^0.18.0"
}
}

View file

@ -1 +0,0 @@
ECHO We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm

View file

@ -1,2 +0,0 @@
#!/usr/bin/env bash
echo "We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm"

View file

@ -1,6 +1,6 @@
port module Main exposing (..)
import Test.Runner.Node exposing (run)
import Test.Runner.Node exposing (run, TestProgram)
import Json.Encode exposing (Value)
import Test exposing (..)
import Expect
@ -14,62 +14,62 @@ tests =
[ test "empty list" <|
\() -> Expect.equal 0 (ListOps.length [])
, test "non-empty list" <|
\() -> Expect.equal 4 (ListOps.length [1..4])
\() -> Expect.equal 4 (ListOps.length (List.range 1 4))
]
, describe "reverse"
[ test "empty list" <|
\() -> Expect.equal [] (ListOps.reverse [])
, test "non-empty list" <|
\() -> Expect.equal [ 4, 3, 2, 1 ] (ListOps.reverse [1..4])
\() -> Expect.equal [ 4, 3, 2, 1 ] (ListOps.reverse (List.range 1 4))
]
, describe "map"
[ test "empty list" <|
\() -> Expect.equal [] (ListOps.map ((+) 1) [])
, test "non-empty list" <|
\() -> Expect.equal [2..5] (ListOps.map ((+) 1) [1..4])
\() -> Expect.equal (List.range 2 5) (ListOps.map ((+) 1) (List.range 1 4))
]
, describe "filter"
[ test "empty list" <|
\() -> Expect.equal [] (ListOps.filter (\_ -> True) [])
, test "non-empty list" <|
\() -> Expect.equal [ 2, 4 ] (ListOps.filter (\x -> x % 2 == 0) [1..4])
\() -> Expect.equal [ 2, 4 ] (ListOps.filter (\x -> x % 2 == 0) (List.range 1 4))
]
, describe "foldl"
[ test "empty list" <|
\() -> Expect.equal 0 (ListOps.foldl (+) 0 [])
, test "non-empty list" <|
\() -> Expect.equal 10 (ListOps.foldl (+) 0 [1..4])
\() -> Expect.equal 10 (ListOps.foldl (+) 0 (List.range 1 4))
, test "direction" <|
\() -> Expect.equal [ 4, 3, 2, 1 ] (ListOps.foldl (::) [] [1..4])
\() -> Expect.equal [ 4, 3, 2, 1 ] (ListOps.foldl (::) [] (List.range 1 4))
]
, describe "foldr"
[ test "empty list" <|
\() -> Expect.equal 0 (ListOps.foldr (+) 0 [])
, test "non-empty list" <|
\() -> Expect.equal 10 (ListOps.foldr (+) 0 [1..4])
\() -> Expect.equal 10 (ListOps.foldr (+) 0 (List.range 1 4))
, test "direction" <|
\() -> Expect.equal [1..4] (ListOps.foldr (::) [] [1..4])
\() -> Expect.equal (List.range 1 4) (ListOps.foldr (::) [] (List.range 1 4))
]
, describe "append"
[ test "empty lists" <|
\() -> Expect.equal [] (ListOps.append [] [])
, test "empty and non-empty lists" <|
\() -> Expect.equal [1..4] (ListOps.append [] [1..4])
\() -> Expect.equal (List.range 1 4) (ListOps.append [] (List.range 1 4))
, test "non-empty and empty lists" <|
\() -> Expect.equal [1..4] (ListOps.append [1..4] [])
\() -> Expect.equal (List.range 1 4) (ListOps.append (List.range 1 4) [])
, test "non-empty lists" <|
\() -> Expect.equal [1..8] (ListOps.append [1..4] [5..8])
\() -> Expect.equal (List.range 1 8) (ListOps.append (List.range 1 4) (List.range 5 8))
]
, describe "concat"
[ test "empty list" <|
\() -> Expect.equal [] (ListOps.concat [])
, test "list of lists" <|
\() -> Expect.equal [1..10] (ListOps.concat [ [1..3], [], [4..7], [8..10] ])
\() -> Expect.equal (List.range 1 10) (ListOps.concat [ List.range 1 3, [], List.range 4 7, List.range 8 10 ])
]
]
main : Program Value
main : TestProgram
main =
run emit tests

View file

@ -8,9 +8,9 @@
],
"exposed-modules": [],
"dependencies": {
"elm-lang/core": "4.0.0 <= v < 5.0.0",
"elm-community/elm-test": "2.0.0 <= v < 3.0.0",
"rtfeldman/node-test-runner": "2.0.0 <= v < 3.0.0"
"elm-lang/core": "5.0.0 <= v < 6.0.0",
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
"elm-version": "0.18.0 <= v < 0.19.0"
}

View file

@ -0,0 +1,13 @@
{
"description": "Excercism/Elm",
"repository": "https://github.com/exercism/xelm.git",
"license": "MIT",
"scripts": {
"postinstall": "elm-package install -y",
"test": "elm-test Tests.elm"
},
"dependencies": {
"elm": "^0.18.0",
"elm-test": "^0.18.0"
}
}

View file

@ -1 +0,0 @@
ECHO We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm

View file

@ -1,2 +0,0 @@
#!/usr/bin/env bash
echo "We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm"

View file

@ -1,6 +1,6 @@
port module Main exposing (..)
import Test.Runner.Node exposing (run)
import Test.Runner.Node exposing (run, TestProgram)
import Json.Encode exposing (Value)
import Test exposing (..)
import Expect
@ -27,7 +27,7 @@ tests =
]
main : Program Value
main : TestProgram
main =
run emit tests

View file

@ -8,9 +8,9 @@
],
"exposed-modules": [],
"dependencies": {
"elm-lang/core": "4.0.0 <= v < 5.0.0",
"elm-community/elm-test": "2.0.0 <= v < 3.0.0",
"rtfeldman/node-test-runner": "2.0.0 <= v < 3.0.0"
"elm-lang/core": "5.0.0 <= v < 6.0.0",
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
"elm-version": "0.18.0 <= v < 0.19.0"
}

View file

@ -0,0 +1,13 @@
{
"description": "Excercism/Elm",
"repository": "https://github.com/exercism/xelm.git",
"license": "MIT",
"scripts": {
"postinstall": "elm-package install -y",
"test": "elm-test Tests.elm"
},
"dependencies": {
"elm": "^0.18.0",
"elm-test": "^0.18.0"
}
}

View file

@ -1 +0,0 @@
ECHO We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm

View file

@ -1,2 +0,0 @@
#!/usr/bin/env bash
echo "We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm"

View file

@ -1,6 +1,6 @@
port module Main exposing (..)
import Test.Runner.Node exposing (run)
import Test.Runner.Node exposing (run, TestProgram)
import Json.Encode exposing (Value)
import Test exposing (..)
import Expect
@ -49,7 +49,7 @@ tests =
]
main : Program Value
main : TestProgram
main =
run emit tests

View file

@ -8,9 +8,9 @@
],
"exposed-modules": [],
"dependencies": {
"elm-lang/core": "4.0.0 <= v < 5.0.0",
"elm-community/elm-test": "2.0.0 <= v < 3.0.0",
"rtfeldman/node-test-runner": "2.0.0 <= v < 3.0.0"
"elm-lang/core": "5.0.0 <= v < 6.0.0",
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
"elm-version": "0.18.0 <= v < 0.19.0"
}

View file

@ -0,0 +1,13 @@
{
"description": "Excercism/Elm",
"repository": "https://github.com/exercism/xelm.git",
"license": "MIT",
"scripts": {
"postinstall": "elm-package install -y",
"test": "elm-test Tests.elm"
},
"dependencies": {
"elm": "^0.18.0",
"elm-test": "^0.18.0"
}
}

View file

@ -1 +0,0 @@
ECHO We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm

View file

@ -1,2 +0,0 @@
#!/usr/bin/env bash
echo "We've changed how tests are run! Please review the latest install/running docs at http://exercism.io/languages/elm and report any issues at https://github.com/exercism/xelm"

Some files were not shown because too many files have changed in this diff Show more