Skip to content

Conversation

@ezzieyguywuf
Copy link
Contributor

  • FIXME: this test doesn't actually do anything yet
  • Do not call clang-format if buffer is empty.

I did my best to generate a unit test that duplicates the bug, however I've stared
it at so long I'm going cross-eyed and I still cannot figure out a good way to do this.

My problem is I'm not sure how to check the output of :FormatCode clang-format for
an error (or lack thereof). I tried using a try-catch but was unsure how to
do this with vroom while still intercepting the system calls to provide a mocked
response.

Any help on figuring out a good unit test for this would be greatly appreciated.

@dbarnett
Copy link
Contributor

I think you want maktaba#error#TryCommand: https://github.com/google/vim-maktaba/blob/46730b0d818da2da005e3c8a38ff987a2dd36d7c/vroom/error.vroom#L265

Vroom is easily confused by splitting stateful commands across lines and even more confused by trying to catch errors in vimscript.

@ezzieyguywuf ezzieyguywuf force-pushed the master branch 2 times, most recently from b7bf8bc to e9f25ff Compare January 22, 2022 17:24
Copy link
Contributor

@dbarnett dbarnett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, one question about the clang-format invocation and one minor question in the vroom test.

Signed-off-by: Wolfgang E. Sanyer <WolfgangSanyer@Google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants