datacamp / testwhat

Write Submission Correctness Tests for R exercises
https://datacamp.github.io/testwhat
GNU Affero General Public License v3.0
33 stars 24 forks source link

Testing for the negation of check_function() or check_code() #224

Open terhorst opened 5 years ago

terhorst commented 5 years ago

I am using this package to for an intro data science class. In one exercise the students need to compute the entry-wise maximum of two columns of data. One correct way to do this is using pmax(), and a common beginner mistake is to use max() instead. In testing their solution, I would like to provide some feedback based on if they are calling max(). Is there a way to do this? It's sort of the negation of a check_function() or check_code() call.

hermansje commented 5 years ago

There is no easy approach yet for that check. You can check this issue for different suggestions on how you can emulate such a test.

As you are using this to support a class, this might also be of interest to you: