ray-x / go.nvim

G'day Nvimer, Joyful Gopher: Discover the Feature-Rich Go Plugin for Neovim
MIT License
2.08k stars 122 forks source link

GoTestFunc got error #9

Closed tinytub closed 3 years ago

tinytub commented 3 years ago

run GoTestFunc in my test function and got an error

E488: 多余的尾部字符: :Gmake -run ..

Is there some dependence I missed ?

ray-x commented 3 years ago

My bad. There were some missing pieces. I fixed that and also made some improvements. Thanks

Rizary commented 3 years ago

@ray-x when I run :GoTestFunc I got an error Unable to find any nodes. Is your query correct?.

In my understanding, I need to point the cursor to the test function and run the above command. Any idea?

ray-x commented 3 years ago

You should be able to test the current test function if the cursor is inside the test function scope. (anywhere from function name to end of the function

Rizary commented 3 years ago

@ray-x yes, I placed the cursor in the function name but still got the unable to find any nodes error. I already install gotests and available on my path.

ray-x commented 3 years ago

image

Would you send a screen shot or your code snippet so I can reproduce it?

Also gotests is not a unit test tool. It is used to generate table-driven test cases. It is irreverent to test runner

Rizary commented 3 years ago

@ray-x I want to test this function: https://github.com/0chain/gosdk/blob/rizary-wallet-zboxsdk/wasm/wallet_test.go#L21

normally we use GOOS=js GOARCH=wasm go test -v github.com/0chain/gosdk/wasm -run TestSetWalletInfo

ray-x commented 3 years ago

image

Suppose you export GOOS and GOARCH before you run neovim. It should work.

Did you update and install treesitter? That is required to parse the function name.

Do you see any error if you runcheckhealth

Rizary commented 3 years ago

@ray-x thank you, it seems I have not setup the treesitter well. Thanks again for the plugin, it helps me as nvim beginner.