added tests for Create and Split Cascade Refactoring#19446
added tests for Create and Split Cascade Refactoring#19446jainoshika wants to merge 2 commits intopharo-project:Pharo14from
Conversation
| x := obj | ||
| bar; | ||
| baz.') | ||
| ] |
There was a problem hiding this comment.
the previous example is not really good.
I would expect
obj foo.
obj bar.
x := obj baz
There was a problem hiding this comment.
yes, that should be the expected behaviour. but i see the method implementation does not support complete flattening and assigning the last, rather it depends on where the cursor is placed.
| #package : 'Refactoring-Transformations-Tests', | ||
| #tag : 'Test' | ||
| } | ||
|
|
There was a problem hiding this comment.
I have the impression that the from: argument is not that great
There was a problem hiding this comment.
i changed it to #example currently. if you may share the reasons behind, i will try to think of more.
|
I have the impression that this refactoring is not fully specified. |
I agree, shall i go through the implementation first and check out the issues in it? |
|
I made changes in the But i am quite confused how the refactoring is supposed to work. the comment says that it divides in 2 parts so then, |
balsa-sarenac
left a comment
There was a problem hiding this comment.
I think it's really good that we got these tests!
What I don't like is how split cascade works right now. For me, it has weird interface. We should discuss what would be a good interface.
I'd like to suggest we create a small UI that by default does best guess split, then you have small check boxes between message calls where you can check them to make those calls be cascade or not, so user ultimately picks what will be split and what isn't.
We can also rely on selection for splitting - example: all cascades in selection will be split, before or after it we preserve cascade. This might be harder since users don't know this and is not intuitive.
| baz'. | ||
| self should: [ ref generateChanges ] | ||
| raise: RBRefactoringError. | ||
| ] |
There was a problem hiding this comment.
For me this would pass, I'd split after first message here, better UX too.
I'm not saying we should implement this in this PR.
| baz'. | ||
| self should: [ ref generateChanges ] | ||
| raise: RBRefactoringError. | ||
| ] |
There was a problem hiding this comment.
I'd also expect this to do:
obj foo.
obj bar.
obj baz.But this might only be me.
I'm not saying we should do this in this PR, we should discuss this.
I really like this idea, it will give the user more options and control. |
Tests are added for
RBCreateCascadeRefactoringandRBSplitCascadeRefactoringin Refactoring-Transformations-Tests.To broaden test coverage, some edge cases are explored with the help of an LLM. These tests were reviewed to ensure they are correct for the refactoring. If any changes do let me know.
Fixes #12533