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

RBCodeSnippet format, tidify and better default mechanism #13109

Merged
merged 4 commits into from
Mar 22, 2023

Conversation

privat
Copy link
Contributor

@privat privat commented Mar 22, 2023

This is a simple (but important) cleanup of the code snippet definitions.

RBCodeSnippet was introduced to help to test a lot of piece of codes on a lot of code processing and tools (thanks to matrix testing). There are more than 4700 (green) tests right now; something that could not scale if wrote by hand.
Especially, it helped me to prevent numerous breakages when dealing with compiler work.

Currently, expected results on snippets are quite limited: is there a syntax error? what is the value if I execute it? etc.
Therefore, if RBCodeSnippet become larger with more snippets and more kind of tests (thus more expected results to fill), it will also start to have scaling issues: how to add new expected results on numerous existing snippets, and how to add new snippets and declare the expected results of numerous tests. It's the problem of matrix testing, you have somehow to have a way to declare (or to compute) the value of each individual cells.

So this PR does 3 things:

  • Reformat the source of methods listing the snippet.
    While I do not appreciate the format style that much, it will be less difficult to maintain in the long term.
  • Provide "inheritance" of snippets. That allows a default snippet to mass-define the characteristics of other snippets.
    In fact, it was already done by hand, but not it's simpler, cleaner, and more powerful.
  • Prepare future PR that will add new kind of tests.

The full diff is huge because of reformatting, but it is isolated in the first commit, so other commits are shorter and simpler.

@MarcusDenker MarcusDenker merged commit e8cc2c4 into pharo-project:Pharo12 Mar 22, 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.

2 participants