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 user defined errors for easier testing #32

Closed
naterush opened this issue Oct 12, 2017 · 2 comments
Closed

Add user defined errors for easier testing #32

naterush opened this issue Oct 12, 2017 · 2 comments

Comments

@naterush
Copy link
Collaborator

naterush commented Oct 12, 2017

Issue

Currently, if we want to test that some condition is false (e.g. that some block is not the forkchoice), we can construct a string that asserts it is true, and then test that running the testing language with this string fails an assertion. However, we cannot be sure which assert is really causing the error to fail.

See discussion #19 for more details.

Implementation

Add necessary user-defined errors (like ForkChoiceError) that allow us to check the correct part of the test is failing.

@naterush
Copy link
Collaborator Author

@djrtwo I'm not totally sold on the above. I think a better solution to this might be adding a check_not_forkchoice (or the equivalent), so we can make any checks we need and be able to continue with the test (which is not trivial when an error is thrown).

Essentially - we say that the testing language itself should never fail, but we give it the ability to check any situations it might be in. Let me know your thoughts. Might be totally off base here :)

@djrtwo
Copy link
Collaborator

djrtwo commented Oct 12, 2017

Yeah, you're right. I hadn't thought it through all the way.

At this point, I just want to ensure TestLangCBC is correct by adding some tests. See #35

@djrtwo djrtwo closed this as completed Oct 12, 2017
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

2 participants