Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Fix "gotests" when generates test for current function #656

Closed
clamoriniere opened this issue Nov 28, 2016 · 3 comments
Closed

Fix "gotests" when generates test for current function #656

clamoriniere opened this issue Nov 28, 2016 · 3 comments

Comments

@clamoriniere
Copy link
Contributor

Issue: "Generate unit tests for current function" fails with recent vscode-go version. This due to the fact that the GoDocumentSymbolProvider returns now also the receiverType in the name function.

example:

  • before DecodeJSON
  • last vscode-go version: (*Volume).DecodeJSON

gotests bin is not able to understand this string with the option -only since it is not a valid regular expression.

Fix: check is the function name contains a ".", if yes: returns only the second part of the name that is corresponding to the function name without the receiverType.

clamoriniere added a commit to clamoriniere/vscode-go that referenced this issue Nov 28, 2016
Issue:
"Generate unit tests for current function" fails with recent
vscode-go version. This due to the fact that the GoDocumentSymbolProvider
returns now also the receiverType in the name function.
example: before "DecodeJSON", after (*Volume).DecodeJSON
gotests bin is not able to understand this string with the option -only
since it is not a valid regular expression.

Fixes: microsoft#656
check is the function name contains a ".", if yes: returns only the
second part of the name that is corresponding to the function name
without the receiverType.
clamoriniere added a commit to clamoriniere/vscode-go that referenced this issue Nov 28, 2016
Issue:
"Generate unit tests for current function" fails with recent
vscode-go version. This due to the fact that the GoDocumentSymbolProvider
returns now also the receiverType in the name function.
example: before "DecodeJSON", after (*Volume).DecodeJSON
gotests bin is not able to understand this string with the option -only
since it is not a valid regular expression.

Fixes: microsoft#656
check is the function name contains a ".", if yes: returns only the
second part of the name that is corresponding to the function name
without the receiverType.
clamoriniere added a commit to clamoriniere/vscode-go that referenced this issue Nov 28, 2016
Issue:
"Generate unit tests for current function" fails with recent
vscode-go version. This due to the fact that the GoDocumentSymbolProvider
returns now also the receiverType in the name function.
example: before "DecodeJSON", after (*Volume).DecodeJSON
gotests bin is not able to understand this string with the option -only
since it is not a valid regular expression.

Fixes: microsoft#656
check is the function name contains a ".", if yes: returns only the
second part of the name that is corresponding to the function name
without the receiverType.
clamoriniere added a commit to clamoriniere/vscode-go that referenced this issue Nov 28, 2016
Issue:
"Generate unit tests for current function" fails with recent
vscode-go version. This due to the fact that the GoDocumentSymbolProvider
returns now also the receiverType in the name function.
example: before "DecodeJSON", after (*Volume).DecodeJSON
gotests bin is not able to understand this string with the option -only
since it is not a valid regular expression.

Fixes: microsoft#656
check is the function name contains a ".", if yes: returns only the
second part of the name that is corresponding to the function name
without the receiverType.
clamoriniere added a commit to clamoriniere/vscode-go that referenced this issue Nov 28, 2016
Issue:
"Generate unit tests for current function" fails with recent
vscode-go version. This due to the fact that the GoDocumentSymbolProvider
returns now also the receiverType in the name function.
example: before "DecodeJSON", after (*Volume).DecodeJSON
gotests bin is not able to understand this string with the option -only
since it is not a valid regular expression.

Fixes: microsoft#656
check is the function name contains a ".", if yes: returns only the
second part of the name that is corresponding to the function name
without the receiverType.
@ramya-rao-a
Copy link
Contributor

Are you sure this worked before?
GoDocumentSymbolProvider and the tool it uses (go-outline) hasn't seen any changes recently regarding its output.
So I don't see any reason why this would work before and only the recent Go extension would break it

clamoriniere added a commit to clamoriniere/vscode-go that referenced this issue Nov 28, 2016
Issue:
"Generate unit tests for current function" fails with recent
vscode-go version. This due to the fact that the GoDocumentSymbolProvider
returns now also the receiverType in the name function.
example: before "DecodeJSON", after (*Volume).DecodeJSON
gotests bin is not able to understand this string with the option -only
since it is not a valid regular expression.

Fixes: microsoft#656
check is the function name contains a ".", if yes: returns only the
second part of the name that is corresponding to the function name
without the receiverType.
clamoriniere added a commit to clamoriniere/vscode-go that referenced this issue Nov 28, 2016
Issue:
"Generate unit tests for current function" fails with recent
vscode-go version. This due to the fact that the GoDocumentSymbolProvider
returns now also the receiverType in the name function.
example: before "DecodeJSON", after (*Volume).DecodeJSON
gotests bin is not able to understand this string with the option -only
since it is not a valid regular expression.

Fixes: microsoft#656
check is the function name contains a ".", if yes: returns only the
second part of the name that is corresponding to the function name
without the receiverType.
clamoriniere added a commit to clamoriniere/vscode-go that referenced this issue Nov 29, 2016
Issue:
"Generate unit tests for current function" fails with recent
vscode-go version. This due to the fact that the GoDocumentSymbolProvider
returns now also the receiverType in the name function.
example: before "DecodeJSON", after (*Volume).DecodeJSON
gotests bin is not able to understand this string with the option -only
since it is not a valid regular expression.

Fixes: microsoft#656
check is the function name contains a ".", if yes: returns only the
second part of the name that is corresponding to the function name
without the receiverType.
clamoriniere added a commit to clamoriniere/vscode-go that referenced this issue Nov 29, 2016
Issue:
"Generate unit tests for current function" fails with recent
vscode-go version. This due to the fact that the GoDocumentSymbolProvider
returns now also the receiverType in the name function.
example: before "DecodeJSON", after (*Volume).DecodeJSON
gotests bin is not able to understand this string with the option -only
since it is not a valid regular expression.

Fixes: microsoft#656
check is the function name contains a ".", if yes: returns only the
second part of the name that is corresponding to the function name
without the receiverType.
@clamoriniere
Copy link
Contributor Author

clamoriniere commented Nov 29, 2016

So maybe the feature never worked properly from the beginning :(
It was only tested with a global function and not a method of a type.

@clamoriniere
Copy link
Contributor Author

I also opened an Issue to gotests for a feature request in order to support the type in the regular expression input with the -only option.

link: cweill/gotests#35

ramya-rao-a pushed a commit that referenced this issue Nov 29, 2016
…ds (#657)

Issue:
"Generate unit tests for current function" fails with recent
vscode-go version. This due to the fact that the GoDocumentSymbolProvider
returns now also the receiverType in the name function.
example: before "DecodeJSON", after (*Volume).DecodeJSON
gotests bin is not able to understand this string with the option -only
since it is not a valid regular expression.

Fixes: #656
check is the function name contains a ".", if yes: returns only the
second part of the name that is corresponding to the function name
without the receiverType.
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants