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

go/ast: provide test for Filter func #26022

Open
arthurkushman opened this issue Jun 23, 2018 · 1 comment
Open

go/ast: provide test for Filter func #26022

arthurkushman opened this issue Jun 23, 2018 · 1 comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@arthurkushman
Copy link

What version of Go are you using (go version)?

go version go1.9.2 linux/amd64

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/srv/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build760291292=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

Add TestFilter function to test comments after filtering

What did you expect to see?

TestFilter function runs with all checks passed

arthurkushman added a commit to arthurkushman/go that referenced this issue Jun 23, 2018
The existing implementation of Filter should behave as if it removes (filter out) comments from parsed AST (by providing filter Node argument) leaving the rest untouched.

The TestFilter - checks for length differences of both filtered and unfiltered as general and then for excluded from ASTree.

Add FilterTest golang#26022
@gopherbot
Copy link

Change https://golang.org/cl/120675 mentions this issue: go/ast: add Filter func test on AST

arthurkushman added a commit to arthurkushman/go that referenced this issue Jun 26, 2018
Fixed issues with fragile implementation for TestFilter applying additional check on x var, added new comments source, changed some obscure comments, added new lines before comments

Fix FilterTest golang#26022
@bcmills bcmills added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 26, 2018
@bcmills bcmills added this to the Unplanned milestone Jun 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants