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

Highlight the correct line for runtime errors in wrapped code #115

Open
sapi opened this issue Feb 23, 2015 · 0 comments
Open

Highlight the correct line for runtime errors in wrapped code #115

sapi opened this issue Feb 23, 2015 · 0 comments

Comments

@sapi
Copy link
Contributor

sapi commented Feb 23, 2015

The line number of runtime errors is extracted in TestResult._addResult and used to indicate which line, if any, should be highlighted for a particular test.

In the case of compile errors, this is achieved directly in the run_test function.

The latter function has access to whether the student code has been wrapped or not, and if so, how many lines of padding were added at the top of the file. The former does not; it is far too deep in the testing hierarchy to know that.

As a result, the incorrect line is highlighted for runtime errors in wrapped code. At the moment, this means they are off by one (but that could change if the wrapping changes).

Because the code is being execed, we don't have access to the actual source of the error line, meaning we can't match on that. Using a global would be possible, but for now I'd rather have the error than complicate the framework in that way.

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

1 participant