Testing solar calculator in Elm?

Then you can use this approach to test large numbers of input-output pairs:

toTest : (Int, Int) -> Test
toTest ((input, expectedOutput) as case) =
  Test.test (Debug.toString case) <|
    \() ->
      input
        |> Foo.doSomething
        |> Expect.equal expectedOutput

tests : Test
tests =
  [(123,999)
  ,(159,438)
  ,...
  ]
  |> List.map toTest
  |> Test.describe "Foo tests"
1 Like