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

Refactor tests to not test functions that ought to be private (but which are currently marked as public) #12

Open
yousefmoazzam opened this issue Feb 3, 2025 · 0 comments

Comments

@yousefmoazzam
Copy link
Owner

The fix in this commit is a good example of an issue not being caught due to testing private functions (in particular, testing the parsing functions for lower-level AST node generation), but not testing the top-level parsing function: ed38cc2.

If the tests for the C AST node parsing were only testing the top-level function in the parse::c module, then that bug would have been caught, but instead it was missed because:

  • the tests of the parsing function for statement AST nodes didn't require the distinction between a factor and an expression in order to pass
  • but when running the top-level parsing function (via the binary crate) on a test C program using a single binary operation, that failed
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

1 participant