Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test cases for poly #45

Open
sdiehl opened this issue Jan 27, 2015 · 2 comments
Open

test cases for poly #45

sdiehl opened this issue Jan 27, 2015 · 2 comments

Comments

@sdiehl
Copy link
Owner

sdiehl commented Jan 27, 2015

Add test cases to test.ml for pathological cases on pull request #40 issue

@chsievers
Copy link
Contributor

I'd rather call them non-trivial.

The example

\f n -> if True then n else (f (n+1))

is just a trimmed down version of the useful function

let rec findfrom p n = if (p n) then n else (findfrom p (n+1))

I'd preserve "pathological" for cases like

let c x y = if True then x else y
c(c(c(c(c(c(c(c(c c))))))))

(which always worked).

@sdiehl
Copy link
Owner Author

sdiehl commented Jan 28, 2015

That's fair, I'll start doing what GHC does and add a should_fail and should_pass folder for the failure cases. 53f1e5c

So now to test for regressions, it's just:

$ poly test test/should_fail/test_if.ml

For the more complicated ProtoHaskell compiler, I already use the tasty golden test runner. But it's a little heavy for these little toy language though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants