Considering receiverType on function test creation issue-2282#2987
Considering receiverType on function test creation issue-2282#2987ramya-rao-a merged 4 commits intomicrosoft:masterfrom
Conversation
ramya-rao-a
left a comment
There was a problem hiding this comment.
Looks like this is your first PR contribution to this project @marcel-basel, Thanks & Welcome!
| if (funcName.includes('.')) { | ||
| funcName = funcName.split('.')[1]; | ||
| if (funcName.includes('.')) { // receiverType specified | ||
| let funcNameParts = funcName.match(/^\(\*?(.*)\)\.(.*)$/); |
There was a problem hiding this comment.
If we are going to use a regular expression, then the if (funcName.includes('.')) check is redundant right?
Do we foresee the function name to include . in a non receiverType case?
There was a problem hiding this comment.
Hi Ramya, thanks for your fantastic work on the extension!
I removed the if (funcName.includes('.')) block. I don't see an other case where the function name would include . Do you?
There was a problem hiding this comment.
Nope, change looks good. I have pushed a commit to fix the linting errors, we are good to merge now
|
Thanks @ramya-rao-a, do you consider #2282 as closable? |
|
I'll be closing it once I release an update with the fix. |
The receiver type for a method is now considered. So, if there are >= 1 method names in the same file, then clicking "generate unit tests for function" creates test functions only for the selected method.
funcName like "(*Point).Move" will results in "gotests -w -only ^PointMove$ calls.