-
-
Notifications
You must be signed in to change notification settings - Fork 29
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 more tests #5
Comments
I can help for this package. 😃 |
Wise choice. I think the task is the easiest in this package compared to the other two. 😁 Thanks! |
Some functions are difficult to test... Finally, I choose to finish all the simpler ones first. |
Still only 21%... 😢 Thought it may go to 50%. I'll come back... 🏃 |
It is not necessary to test all functions. I'm totally fine if only simpler tests are done. The detailed statistics here can help you target the functions and lines to test (click on each R script to know which lines are not covered): https://codecov.io/gh/yihui/xfun/tree/master/R Thanks! |
Hi @yihui I was hoping I can start with something simple. I checked https://codecov.io/gh/yihui/xfun/src/master/R/os.R and gave it a try.
All the above tests gave proper results in my windows machine.
I can try testing this again on my linux system at home. Other than that, I don't have a mac so I'm not sure how to test on a mac system. Please let me know how to proceed further. I'm not sure how to make the codecove link to become a 100% (?). If this works out then I can try pitching in for other scripts. :) |
@kishvanchee Testing these OS-related functions on different OSes is a little tricky and probably unnecessary, since they are super simple functions. I'd suggest you work on other functions instead. Thank you! |
@yihui Understood. I thought of starting with markdown.R now. I am trying to understand why the tests failed. Can you please share examples for the same? I can see from the doc strings it's performing the required function and gives the appropriate output. |
Sorry I don't understand it. What do you mean by "examples for the same"? Where are your tests? You could submit a PR even if you haven't finished it, so I can see how the tests are failing on Travis CI. |
Apologies for not being clear. Looking at the red highlight I understood that those are the lines that fail. So that is why I was asking for the examples - I meant the tests for which they failed to make them highlight as red. Ok, to clarify, how exactly should I go about this? Currently, I installed the package(s) and did assert (conditions). Should I be cloning this repo and run some script to test things out? |
I see. One simple example: assert('protect_math() puts inline math expressions in backticks', {
(xfun::protect_math('$x$') %==% '`\\(x\\)`')
}) You don't need to test anything locally. You can just submit a PR and let Travis perform |
Ok, so I poked around a little, I just noticed the Am I correct in understanding it now? Ok cool. I can perform a PR. I am familiar with it. Hope I can help with your package in some way. :) |
Yes, you are 100% correct! (Red lines means they are not covered by any tests) |
Hi! I wanted to add some more tests and I stumbled upon some things that I need to clear up first:
I guess that is the expected output, right? (we just see the error messages here, not that the tests are wrong). Do we want to supress these kind of messages? Especially the 1 warning since it's been outputed in the (2) below.
and this one:
So, is it just me that gets this errors when running via the (2) way the tests? Shouldn't we have the same output as in the first case or should I just not use the (2) way? Notably, the second does not work in that case even if I put |
@bblodfon For 2, you need to install the package ( |
I have started writing some tests in a separate branch - @yihui would you mind giving me access to push it upstream at some point? (I will send a PR when I am done) |
@bblodfon You don't need the write access to this repo. You can do everything in your own fork, and send a PR. Thanks! |
…sts; the temp directory will be deleted after the R session ends this will no longer be necessary: yihui/xfun#5 (comment)
@bblodfon FYI, the |
Coverage is 0% at the moment 😞
https://codecov.io/github/yihui/xfun?branch=master
The text was updated successfully, but these errors were encountered: