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

Implementing PartialEq; adding assert_r_eq! macro #33

Merged
merged 1 commit into from
Aug 27, 2023
Merged

Conversation

dgkf
Copy link
Owner

@dgkf dgkf commented Aug 27, 2023

  • Derives PartialEq for all lang and ast objects
  • Had to do some nasty up-and-back-downcasting magic to implement PartialEq for Primitives, thankfully covered in "Learning Rust" and was pretty easy to adapt.
  • Added a assert_r_eq! macro that will parse and evaluate (most) R code and compare the output of the test case and expectation

Comment on lines +109 to 114
fn numeric_input() {
assert_r_eq!(
R{ paste(1, 2, collapse = NULL) },
R{ "1 2" }
);
}
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@armenic Added some test helpers! Much less boilerplate needed now to test the R interface. Hopefully this makes it easier to keep up with test writing. Thanks for being the driving force behind getting us started with more testing!

@dgkf dgkf merged commit e468d87 into main Aug 27, 2023
@dgkf dgkf deleted the 32-improve-testing branch August 27, 2023 03:21
@dgkf dgkf mentioned this pull request Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant