wende / elchemy

Write Elixir code using statically-typed Elm-like syntax (compatible with Elm tooling)
https://wende.github.io/elchemy/
MIT License
1.15k stars 28 forks source link

Implement purity tests for FFI based on property testing #162

Open wende opened 6 years ago

wende commented 6 years ago

Along with typetests which verify the spec of a function we want a property test that checks whether used FFI call is pure and total.

For example:

myDivision : Float -> Float -> Float
myDivision =
  ffi "Kernel" "/"

Should verify "all" possible incomes and outcomes:

Example 2

myMap : (Bool -> Int) -> List Bool -> List Int
  1. Generate a function verifying that it took a bool and returning a random int
  2. Generate a list of random length with random bools inside
  3. Check if function always returns a list of integers. If not throw

Etc

OvermindDL1 commented 6 years ago

You might be able to generate these with some of the elixir property testing libraries to save work.

wende commented 6 years ago

Blocked by #202