Re: [go-nuts] Improving on unit test styles

2022-03-04 Thread 'Dan Kortschak' via golang-nuts
On Thu, 2022-03-03 at 05:50 -0800, twp...@gmail.com wrote: > For debugging an individual test case, just skip over all but the > failing test case: > > for i, testCase := range testCases { > if i != 5 { // 5 is the index of the failing test, remove if > statement before committing >

Re: [go-nuts] Improving on unit test styles

2022-03-03 Thread twp...@gmail.com
To identify failing test cases in a table of tests where you don't have individual names you can use its index: for i, testCase := range testCases { t.Run(strconv.Itoa(i), func(t *testing.T) { // ... For debugging an individual test case, just skip over all but the failin

Re: [go-nuts] Improving on unit test styles

2022-02-28 Thread roger peppe
On Fri, 25 Feb 2022, 18:46 'Markus Zimmermann' via golang-nuts, < golang-nuts@googlegroups.com> wrote: > Hi Gophers! > > We were unhappy with the common unit test styles and we think we found a > style that has clear advantages. An in-depth comparison can be found here > https://symflower.com/en/c

Re: [go-nuts] Improving on unit test styles

2022-02-28 Thread 'Dan Kortschak' via golang-nuts
On Fri, 2022-02-25 at 09:26 -0800, 'Markus Zimmermann' via golang-nuts wrote: > Would appreciate your feedback on the style and extension. Would be > also interesting to hear other approaches and conventions that could > help others to write better tests. I'm struggling to understand how you captu

[go-nuts] Improving on unit test styles

2022-02-25 Thread 'Markus Zimmermann' via golang-nuts
Hi Gophers! We were unhappy with the common unit test styles and we think we found a style that has clear advantages. An in-depth comparison can be found here https://symflower.com/en/company/blog/2022/better-table-driven-testing. We also added support for maintaining such tests in our VS Code