-
Notifications
You must be signed in to change notification settings - Fork 36
Add test for xinterpreter #124
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
Conversation
@alexander-penev review please. |
clang-tidy review says "All clean, LGTM! 👍" |
test/test_interpreter.cpp
Outdated
xcpp::interpreter interpreter((int)Args.size(), Args.data()); | ||
|
||
std::string code = "foo = a.isal"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For autocomplete to work, we must first execute some code to include the appropriate header file and then attempt to use desired functions. Functions isalnum
and isalpha
are defined in ctype.h
Тherefore, before the use "complete" function, we must execute this code through the interpreter:
#include <ctype.h>
Something like:
nl::json result = interpreter.execute_request("#include <ctype.h>", /*silent=*/false, ... etc );
However, my experiments showed that maybe there is some problem in the implementation of the "complete" function in CppInterOp, and indeed even with the included library and the code that is appropriate, for example auto i = isal
function does not return any suggestions. It is good to add an issue to report the CppInterOp bug.
It's a good idea to try if the test case code works in Jupyter Notebook or Jupyter Console.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it out in all the platforms and it seems that the code completion is not working for the functions involving importing from the header files. The updated code in this PR shows that it works for normal cases.
clang-tidy review says "All clean, LGTM! 👍" |
clang-tidy review says "All clean, LGTM! 👍" |
clang-tidy review says "All clean, LGTM! 👍" |
@anutosh491 this PR covers #114 but there is a possible bug in CppInterOp. Do you want to close the issue with this simple test case or wait till that bug is resolved? |
clang-tidy review says "All clean, LGTM! 👍" |
clang-tidy review says "All clean, LGTM! 👍" |
clang-tidy review says "All clean, LGTM! 👍" |
@alexander-penev, ping. |
I am wondering why this did not increase code coverage. |
It said it has already been covered, but this is the only piece of code calling that function. And also it shows some code has not been covered even when it has been covered. Maybe codecov is not 100% accurate. |
We seem to have that coverage here: xeus-cpp/test/test_xcpp_kernel.py Line 25 in e4a86ec
It is good to have it on the other place, too. This explains why we did not see coverage increase. |
No description provided.