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

exercise util: fix detection of test updates #685

Closed
coriolinus opened this issue Oct 20, 2018 · 1 comment
Closed

exercise util: fix detection of test updates #685

coriolinus opened this issue Oct 20, 2018 · 1 comment
Labels
track meta/exercise crate Issues dealing with the exercise crate

Comments

@coriolinus
Copy link
Member

Test update detection should operate according to these rules

  • if the generated name for a particular test is test_description_from_the_canonical_data, and there already exists a test named test_description_from_the_canonical_data, then check if the text of the test is equal to the newly generated test text:
    • if the text of the test is equal to the generated test text, then nothing has changed, so we leave the old test in place and do not write the new test
    • if the text of the test is not equal to the generated test text, then something has changed. We can't expect an automatic tool to know which to keep, so we should keep the existing test, change the name by appending a suffix, and insert the generated test. The format I expect is test_description_from_the_canonical_data_N, where N is the lowest integer > 1 which does not generate a name collision
  • if the generated name for a particular test is test_description_from_the_canonical_data, and there already exists a test named description_in_other_words, an automatic tool can't be expected to notice that the test exists already, so simply retain the existing test and also insert the generated test. The tool user or the PR reviewer are the ones who should catch those cases.
  • given the rules above, we need neither //NEW nor //UPDATED. Therefore, those comments should no longer be emitted.
@coriolinus coriolinus added the track meta/exercise crate Issues dealing with the exercise crate label Oct 20, 2018
@senekor
Copy link
Contributor

senekor commented Sep 11, 2023

exercise util has been deleted since, see this thread for more context.

@senekor senekor closed this as not planned Won't fix, can't repro, duplicate, stale Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
track meta/exercise crate Issues dealing with the exercise crate
Projects
None yet
Development

No branches or pull requests

2 participants