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

Allow specification of function names instead of files similar to make_tests_shells_file #6

Closed
lorenzwalthert opened this issue Mar 29, 2018 · 9 comments
Assignees

Comments

@lorenzwalthert
Copy link
Contributor

Looks like an interesting package. A function like make_tests_shells_fun() could be useful if one has several declarations of functions in an R script and want's to add tests for one at a time.

@rorynolan
Copy link
Owner

Hi Lorenz,
That's a good idea. I'll try to implement this in the next few days.
If I haven't done it within 2 weeks, feel free to remind me. I promise I won't get mad.
Thanks for your interest,
Rory

@rorynolan rorynolan self-assigned this Mar 29, 2018
@lorenzwalthert
Copy link
Contributor Author

lorenzwalthert commented Mar 29, 2018

Cool. How do you plan to approach it? I think you could use parse data to find the function declaration in a clean way. Using something along these lines.

utils::getParseData(parse(path))

To find the the path to the function declaration, you could also use my package parsesum. However, I can't promise that it will be on CRAN soon.

@rorynolan
Copy link
Owner

rorynolan commented Mar 29, 2018

For now, I'm going to use the same methods as are used in exampletestr::extract_examples(). These are dirty and I'm not proud of them, but they've worked fine so far. I would love to use parsesum but until it's on CRAN, I can't (because exampletestr must depend on CRAN packages only to be viable for CRAN). Please let me know when parsesum is on CRAN. It would be very useful for cleaning up the internal code in exampletestr.

@rorynolan
Copy link
Owner

Hi @lorenzwalthert,
I've implemented make_test_shell_fun() now. Would you please install the new version with devtools::install_github("rorynolan/exampletestr") and give it a test run?
Much appreciated,
Rory

@rorynolan
Copy link
Owner

Hi @lorenzwalthert,
Do you think you'll have time to try this out? If not I think it's working well and I'm happy to close the issue.

@lorenzwalthert
Copy link
Contributor Author

Thanks @rorynolan. I guess I should but I can only do it next week at earliest. Is it merged into master already?

@rorynolan
Copy link
Owner

Yes @lorenzwalthert, it's part of master. Take all the time you need. I'll probably push the current update to CRAN in a couple of weeks but even if you take longer than that it's fine, I'd appreciate your input and incorporate it for the following release.

@rorynolan
Copy link
Owner

Hey @lorenzwalthert I'm gonna push this update to CRAN now and close the issue. I'm satisfied that it's working now, have been using it myself recently :)
Thanks for the input.
If you use it yourself and have a bug or feature request, feel free to comment below or open a new issue.

@lorenzwalthert
Copy link
Contributor Author

Thanks, and sorry I have not had time to test it.

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

2 participants