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

Comments

Projects
None yet
3 participants
@arthurkushman
Copy link

arthurkushman commented Jun 23, 2018

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

ast_test: add Filter func test on AST
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

This comment has been minimized.

Copy link

gopherbot commented Jun 23, 2018

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

go/ast: add Filter func test on AST
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 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
You can’t perform that action at this time.