-
Notifications
You must be signed in to change notification settings - Fork 36
Add test cases for xutils, xmagics_manager, xpreamble_manager and xbuffer #36
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 test cases for xutils, xmagics_manager, xpreamble_manager and xbuffer #36
Conversation
clang-tidy review says "All clean, LGTM! 👍" |
} | ||
} | ||
|
||
TEST_SUITE("is_match_magics_manager") |
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.
@brauliorivas if I understand correctly you can improve this test to check xmagics_manager::apply
with line magic instead. it would std::regex_search %python same as is_match but also check if the magic can be successfully applied(and possibly record any breaking of the magic commands)
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.
alright! I'll change it
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.
Hey @maximusron I'm working on this test case as you said but I'm having trouble with the apply
function. If you have time, some help would be handy!
@anutosh491 @JohanMabille could you take a look at this PR? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #36 +/- ##
==========================================
- Coverage 49.32% 48.78% -0.54%
==========================================
Files 13 15 +2
Lines 742 783 +41
==========================================
+ Hits 366 382 +16
- Misses 376 401 +25 |
@brauliorivas, do you have any clue which part of the new changes breaks windows? |
I'm going to debug and try to solve the Windows issue. |
clang-tidy review says "All clean, LGTM! 👍" |
xcpp::xmagics_manager* magics = new xcpp::xmagics_manager(); | ||
manager.register_preamble(name, magics); | ||
|
||
xcpp::xholder_preamble& result = manager.operator[](name); |
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.
We should probably annotate with XEUS_CPP_API
the xholder_preamble
class to fix the Windows failure...
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.
Alright, I've added this
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.
Hey @vgvassilev, thank you so much for the help, it worked!
clang-tidy review says "All clean, LGTM! 👍" |
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.
LGTM! However, I'd wait for @anutosh491's review.
I'd like to move forward and rely on a post-commit review here. |
This pull request adds test cases for a few functions in the xcpp library.
should_print_version
Test Suite: Tests verify if the function correctly identifies the presence or absence of the--version
argument.build_interpreter
Test Suite: A test case checks if the function returns a non-null pointer when valid arguments are passed.clone_magics_manager
Test Suite: Tests ensure the function correctly returns a non-null pointer and that the cloned object matches the type of the original magics_manager.is_match
Test Suite: Verifies the function correctly identifies strings that match the regex pattern used inxmagics_manager
.register_and_access
Test Suite: This test verifies the correct registration and access of axpreamble
object within thexpreamble_manager
. It ensures that axpreamble
object can be registered with a name and subsequently accessed using the same name.xbuffer
Test Suite: The new test cases cover thexinput_buffer
,xoutput_buffer
, andxnull
classes, focusing on their interaction with various inputs and outputs. They verify the correct behavior of these classes when handling normal and edge cases, such as empty outputs, the correct invocation of callback functions, and the discarding of output byxnull
.Currently, these new test cases were executed and successfully passed.