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

Add --> true if not present #57

Open
dpsanders opened this issue Aug 19, 2015 · 4 comments
Open

Add --> true if not present #57

dpsanders opened this issue Aug 19, 2015 · 4 comments

Comments

@dpsanders
Copy link

I find myself writing things like

 @fact a == b 

a lot, instead of

 @fact a == b --> true

Could we add the --> true automatically if it is not present, to make it more like Base.Test and save effort? Enabling this could be made optional.

@jakebolewski
Copy link
Contributor

I agree with the sentiment, but I can't come up with a good solution where you could still preserve checking that the fact statement is well formed.

@dpsanders
Copy link
Author

How about first trying the fact statement as is; if it would give the current error, then try adding the --> true and see if now it works? (All this is from a position of ignorance about the internal workings.)

@jakebolewski
Copy link
Contributor

but then any statement would "work" at compile time, even if it did not make sense.

@tbreloff
Copy link
Contributor

Is it possible to call a method towards the end that dispatches on a bool vs anything else:

finalcheck(expr, result::Bool) = result ? SUCCESS() : FAILURE()
finalcheck(expr, result) = NORMAL_HANDLING()

I admit I haven't looked as to whether this is feasible... just an idea.

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

No branches or pull requests

3 participants